Files
powerwall/esxi-scripts/get-snapshots.ps1

17 lines
646 B
PowerShell
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env pwsh
. /opt/idssys/powerwall/settings.ps1
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
echo -en "\033[2K\e[0K\r" -NoNewline
echo -en "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
echo -en "\033[2K\e[0K\r"
echo -e "$snapshots"
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false