This commit is contained in:
2023-10-22 08:24:37 -05:00
parent e1f3a3fdb7
commit 120262baec
3 changed files with 12 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='2.2.90-10212023' VERS='2.2.100-10212023'
noheader=' update service dailytemp ' noheader=' update service dailytemp '

View File

@@ -5,6 +5,6 @@
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null 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 # 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 -WarningAction:SilentlyContinue # get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue

View File

@@ -900,20 +900,17 @@ GET_SNAPSHOTS(){
echo -e "${idsCL[LightGreen]}${PW_ESXI_HOST_NAMES[${ESXIHOST}]} (${ESXIHOST}) " echo -e "${idsCL[LightGreen]}${PW_ESXI_HOST_NAMES[${ESXIHOST}]} (${ESXIHOST}) "
DIVIDER . lightGreen 70 DIVIDER . lightGreen 70
echo -en "${idsCL[LighGreen]}Looking for snapshots...${idsCL[Default]}" echo -en "${idsCL[LighGreen]}Looking for snapshots...${idsCL[Default]}"
result=`${PW_FOLDER}/esxi-scripts/get-snapshots.ps1 ${ESXIHOST}` snapshots=`${PW_FOLDER}/esxi-scripts/get-snapshots.ps1 ${ESXIHOST}`
if [ "${result}" != "" ]; then if [ "${result}" != "" ]; then
echo -en "\033[2K\033[1A" echo -en "\033[2K\033[1A"
# echo ${result} | jq echo ${result}
# for snapshot in $(echo ${snapshots} | jq -r '.[] | @base64'); do
# vm=`echo ${snapshot} | base64 --decode | jq -r '.VM'`
for row in $(echo ${result} | jq -r '.[] | @base64'); do # name=`echo ${snapshot} | base64 --decode | jq -r '.Name'`
vm=`echo ${row} | base64 --decode | jq -r '.VM'` # created=`echo ${snapshot} | base64 --decode | jq -r '.Created'`
name=`echo ${row} | base64 --decode | jq -r '.Name'` # size=`echo ${snapshot} | base64 --decode | jq -r '.SizeGB'`
created=`echo ${row} | base64 --decode | jq -r '.Created'` # echo "$vm - $name - $created - $size"
size=`echo ${row} | base64 --decode | jq -r '.SizeGB'` # done
echo "$vm - $name - $created - $size"
done
else else
echo -e "\033[2K\e[0K\r No snapshots found" echo -e "\033[2K\e[0K\r No snapshots found"