Update get-snapshots.ps1

This commit is contained in:
2024-01-26 16:45:23 -06:00
parent 405dce1250
commit f762eb26bc

View File

@@ -4,13 +4,13 @@
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
echo -en "\033[2K\e[0K\r" -NoNewline
echo -en "Gathering Snapshots ..."
Start-Process 'echo -en "\033[2K\e[0K\r" -NoNewline'
Start-Process '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"
Start-Process 'echo -en "\033[2K\e[0K\r"'
Start-Process echo -e "$snapshots"
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false