18 lines
778 B
PowerShell
Executable File
18 lines
778 B
PowerShell
Executable File
#!/usr/bin/env pwsh
|
||
. /opt/idssys/powerwall/conf/settings.ps1
|
||
|
||
Write-Progress -Activity "Connecting to vCenter [$VCENTERHOST] ..." -PercentComplete 20
|
||
|
||
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
||
|
||
Write-Progress -Activity "Connected! Gathering all VM Snapshots ..." -PercentComplete 80
|
||
|
||
$snapshots = get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb
|
||
# get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue
|
||
|
||
Write-Progress -Activity "Done" -Completed
|
||
|
||
$snapshots | Format-List
|
||
|
||
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|