From 150e9967e994e43d3c0b38761515e155a496c74f Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 26 Jan 2024 16:51:15 -0600 Subject: [PATCH] Update get-snapshots.ps1 --- esxi-scripts/get-snapshots.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esxi-scripts/get-snapshots.ps1 b/esxi-scripts/get-snapshots.ps1 index 4b328f24..d3d134da 100755 --- a/esxi-scripts/get-snapshots.ps1 +++ b/esxi-scripts/get-snapshots.ps1 @@ -2,15 +2,15 @@ . /opt/idssys/powerwall/settings.ps1 +Write-Progress -Activity "Connecting to vCenter..." + Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null -Start-Process 'echo -en "\033[2K\e[0K\r" -NoNewline' -Start-Process 'echo -en "Gathering Snapshots ..."' +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 -Start-Process 'echo -en "\033[2K\e[0K\r"' -Start-Process echo -e "$snapshots" +Write-Progress -Activity "$snapshots" Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false