none
Need to do auto SnapShot to hyperv machine with powershell RRS feed

  • Question

  • Hello,

    I need to do every week once a time snapshot to my v.machine

    and i wnat to do it with power shell and than a task schdular.

    i have a  scrip but i keep geting an error :

    my script:

    $VMManagementService = Get-WmiObject -Namespace root\virtualization -Class Msvm_VirtualSystemManagementService
    $SourceVm = Get-WmiObject -Namespace root\virtualization -Query “Select * From Msvm_ComputerSystem Where ElementName=’Xamp’”
    $result = $VMManagementService.CreateVirtualSystemSnapshot($SourceVm)
    #ProcessWMIJob($result)
    $VMManagementService = Get-WmiObject -Namespace root\virtualization -Class Msvm_VirtualSystemManagementService $SourceVm = Get-WmiObject -Namespace root\virtualization -Query “Select * From Msvm_ComputerSystem Where ElementName=’Xamp’”
    $result = $VMManagementService.CreateVirtualSystemSnapshot($SourceVm) #ProcessWMIJob($result)

    the Error :

     

    Get-WmiObject : Cannot bind parameter because parameter 'Namespace' is specified more than once. To provide multiple values 
    to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value3".

    Any one help ???

    Thursday, May 30, 2013 2:27 PM