Hello everybody
Sorry for being a bother. I expect this to be a pretty dumb question but my google fu is weak today and I just can't find the answer.
I want to create snapshots for a list of VMs. I have them as view objects in a variable. I want to use the createsnapshot_task method and I want to pass it a name for the snapshot. However for the life of me I cannot find any examples on how passing parameters to a method works.
I expect they need to go in the parentheses of $vm.createsnapshot_task() somehow. I have found a list of possible parameters in the API docs but no example on the syntax...
Sorry again...
There are 2 ways of finding out.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
$vm = Get-View -ViewType VirtualMachine -Filter @{'Name'='MyVM'}
$snapshotName = 'Test'
$snapshotDescription = 'Test Snapshot'
$memory = $false
$quiesce = $true
$vm.CreateSnapshot($snapshotName,$snapshotDescription,$memory,$quiesce)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you, this solves my immediate problem.
Can you tell me what the best way is to find this out? I expect the parameters all need to be present and in the right order. Where do I see these requirements for each method?
There are 2 ways of finding out.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you so much. I never would have even tried it without ().
Great to know!