17 lines
668 B
PowerShell
Executable File
17 lines
668 B
PowerShell
Executable File
#!/usr/bin/env pwsh
|
||
|
||
. /opt/idssys/powerwall/settings.ps1
|
||
|
||
Write-Progress -Activity "Connecting to vCenter..."
|
||
|
||
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
||
|
||
Write-Progress -Activity "Gathering Snapshots..."
|
||
|
||
$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 "$snapshots"
|
||
|
||
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|