Update get-snapshots.ps1

This commit is contained in:
2024-01-26 16:51:15 -06:00
parent f762eb26bc
commit 150e9967e9

View File

@@ -2,15 +2,15 @@
. /opt/idssys/powerwall/settings.ps1 . /opt/idssys/powerwall/settings.ps1
Write-Progress -Activity "Connecting to vCenter..."
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
Start-Process 'echo -en "\033[2K\e[0K\r" -NoNewline' Write-Progress -Activity "Gathering Snapshots..."
Start-Process 'echo -en "Gathering Snapshots ..."'
$snapshots = get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb $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 # get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue
Start-Process 'echo -en "\033[2K\e[0K\r"' Write-Progress -Activity "$snapshots"
Start-Process echo -e "$snapshots"
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false