Snapshots are getting deleted one by one when I am executing below Command.
I need to delete all snapshots for specific VMs on a specific Period of time so I would like to schedule the same.
Get-VM VM1 | Remove-Snapshot
Is there any way to delete all Snapshot at a time as we have option in vSphere Client.
Snapshot name will be unique for each VM, Is there any way to select 1st snapshot.
I have tried below that that doesn't work.
Get-VM VM1 | Remove-snapshot -snapshot * -RemoveChildren -confirm:$false
But getting error that * system.string conversion is not possible.
That works fine. Below is the full command which I have used.
Get-VM -Name VM1| Get-Snapshot | Sort-Object -Property Created | Select -First 1 | Remove-Snapshot -RemoveChildren -Confirm:$false
Thank you so much Lucd.