From 4218372f9270c3ccaf7004dd27b24e29c9b55723 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 21 Oct 2023 23:03:55 -0500 Subject: [PATCH] update --- esxi-scripts/get-snapshots.ps1 | 3 ++- powerwall.sh | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/esxi-scripts/get-snapshots.ps1 b/esxi-scripts/get-snapshots.ps1 index 19f93c32..04510c17 100755 --- a/esxi-scripts/get-snapshots.ps1 +++ b/esxi-scripts/get-snapshots.ps1 @@ -5,5 +5,6 @@ Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null # Connect-VIServer -Server 10.2.1.11 -Protocol https -User $ESXiUsername -Password $ESXiPassword | 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 +get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 diff --git a/powerwall.sh b/powerwall.sh index 7341faa7..dc2f1fb7 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -901,7 +901,12 @@ GET_SNAPSHOTS(){ DIVIDER . lightGreen 70 echo -en "${idsCL[LighGreen]}Looking for snapshots...${idsCL[Default]}" result=`${PW_FOLDER}/esxi-scripts/get-snapshots.ps1 ${ESXIHOST}` - [ "${result}" != "" ] && echo -e "\033[2K\033[1A${result}" || echo -e "\033[2K\e[0K\r No snapshots found" + if [ "${result}" != "" ]; then + echo -en "\033[2K\033[1A" + echo ${result} | jq + else + echo -e "\033[2K\e[0K\r No snapshots found" + fi DIVIDER true lightGreen 70 fi done