Hello,
In the earlier version of PowerCLI 6.5 creating a snapshot on multiple VMs was very straightforward.
Example:
1) Group VMs: $VM1 = Get-VM VM1, VM2, VM3, VM4
2) Create snapshots on group VMs: New-Snapshot -VM $VM1 -Name "Your snapshot name" -Description "Your description".
Since from VMware PowerCLI version 10 'VM" parameter no longer accepts an array, this is no longer possible.
Can someone write me an example that can be used with PowerCLI 10?
Use the pipeline
New-Snapshot -Name "Your snapshot name" -Description "Your description".
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Use the pipeline
New-Snapshot -Name "Your snapshot name" -Description "Your description".
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you LucD for your fast and accurate answer.
# https://virtualizationnation.com/2017/02/06/snapshot-removal-powercli/
$Authorization = Get-Credential -Message "Virtual Center Login, use your AD Admin account."
Connect-VIServer -Server abcvcenter.com -AllLinked -Credential $Authorization
# $vmlist = Get-Content C:\Servers.txt
#New-Snapshot -VM $vmlist -Name NameOfSnsphot -Description DescriptionOfSnapshot.
New-Snapshot -VM $vmlist -Name NameOfSnsphot -Description DescriptionOfSnapshot.
New-Snapshot -VM servername -Name "Server Snapshot" -Description "Server Snaphot"
# $vmlist = Get-Content C:\Servers.txt
# Get-VM $vmlist | Get-Snapshot | Remove-Snapshot -Confirm:$false
To remove the snapshots
Get-VM servername | Get-Snapshot | Remove-Snapshot -Confirm:$false -RemoveChildren
Did you actually read the question?
Your solution (?) is in fact the problem
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you ever reach a solution to this?