Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Import-module VMware.VimAutomation.core
- $user = Read-Host 'Username'
- $password = Read-Host 'Password'
- Connect-VIServer -Server vcenter6.esxlan.local -User $user -Password $password
- echo "Voila la liste des Snapshots:"
- get-vm | get-snapshot | where {$_.Name -match "MAJ-UNIX-*"}| Format-Table -Property VM,Name,Created,Description, SizeMB
- $validation = Read-Host 'Pour supprimer les Snapshot tapez YES'
- if ($validation -eq "YES")
- {
- get-vm | get-snapshot | where {$_.Name -match "MAJ-UNIX-*"}| Remove-Snapshot -Confirm:$false -RunAsync
- }
- else { "Vous n'avez pas validé" }
- echo "Fin du script, les snapshots sont supprimés!"
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement