From 3b35808e1a66b166704f2a9de830b068f88d463b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 26 Jan 2024 16:40:38 -0600 Subject: [PATCH] update --- esxi-scripts/get-snapshots.ps1 | 9 ++++++--- powerwall.sh | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/esxi-scripts/get-snapshots.ps1 b/esxi-scripts/get-snapshots.ps1 index b34a8be5..494efc06 100755 --- a/esxi-scripts/get-snapshots.ps1 +++ b/esxi-scripts/get-snapshots.ps1 @@ -4,10 +4,13 @@ Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null -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-host "\033[2K\e[0K\r" -NoNewline write-host "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-host "\033[2K\e[0K\r" -NoNewline +write-host $snapshots + Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false diff --git a/powerwall.sh b/powerwall.sh index 3edc500b..13889617 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -718,9 +718,10 @@ GET_SNAPSHOTS(){ echo -e "\n${idsCL[Yellow]}LISTING ALL VM SNAPHOTS IN VCENTER ${idsCL[Default]}(minus offsite replicas)" DIVIDER . lightGreen 70 echo -en "${idsCL[LightCyan]}Connecting to vCenter ...${idsCL[Default]}" - snapshots=`${PW_FOLDER}/esxi-scripts/get-snapshots.ps1` - echo -en "\033[2K\e[0K\r" - echo -e "${snapshots}" + # snapshots=`${PW_FOLDER}/esxi-scripts/get-snapshots.ps1` + # echo -en "\033[2K\e[0K\r" + # echo -e "${snapshots}" + ${PW_FOLDER}/esxi-scripts/get-snapshots.ps1 echo -e "\n" }