#import powershell community extensions for increased functionality
Import-Module Pscx
#import vmware cli
Add-PSSnapin "Vmware.VimAutomation.Core" -ErrorAction SilentlyContinue
#vm vsphere server
$vsphereServer = "10.x.x.x"
$vsphereUser = "administrator"
$vspherePass = 'password'
#connect to the virtual server the VM's are on
Connect-VIServer -Server $vsphereServer -Protocol https -User $vsphereUser -Password $vspherePass
# Remove all VM snapshot from specific data store.
Get-VM -Datastore "datastorename" | ForEach-Object {$_ | Get-Snapshot | Remove-Snapshot -RunAsync -Confirm:$false}
Find and delete unused VM snapshot
最新推荐文章于 2024-09-22 12:25:58 发布