From d2e512e071e06200b906ae975d177808e49b5be0 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 15 Sep 2023 20:27:10 -0500 Subject: [PATCH] update --- defaults.inc | 2 +- esxi-scripts/get-snapshots.ps1 | 8 ++++++++ powerwall.sh | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 esxi-scripts/get-snapshots.ps1 diff --git a/defaults.inc b/defaults.inc index 5ff2a992..09abdd2b 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.2.62-09092023' +VERS='2.2.63-09152023' noheader=' update service dailytemp ' diff --git a/esxi-scripts/get-snapshots.ps1 b/esxi-scripts/get-snapshots.ps1 new file mode 100755 index 00000000..f7943120 --- /dev/null +++ b/esxi-scripts/get-snapshots.ps1 @@ -0,0 +1,8 @@ +#!/usr/bin/env pwsh + +. /opt/idssys/powerwall/settings.ps1 + +Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword + +get-vm | get-snapshost | select, vm, name, description, created, sizegb + diff --git a/powerwall.sh b/powerwall.sh index 92292e78..8bf05e18 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -888,6 +888,13 @@ LOGROTATE(){ # STARTALL_SERVICES } +GET_SNAPSHOTS(){ + for ESXIHOST in "${PW_SYSHOSTS[@]}"; do + echo -en "${ESXIHOST}" + ${PW_FOLDER}/esxi-scripts/get-snapshots.ps1 ${ESXIHOST} >/dev/null 2>&1 + fi +} + TEST(){ start=`date +%s` temptotal=0 @@ -952,6 +959,8 @@ fi shutdownhost) SHUTDOWN_SERVER ${2};; shutdown_servers) SHUTDOWN_SERVERS ${2};; + get-snapshots) GET_SNAPSHOTS;; + service) if [ "${2}" = "all" ]; then if [ "${3}" == "stop" ]; then