From d02f64fe4d5fc67037f197de4011b47c52919d86 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 7 May 2023 18:46:27 -0500 Subject: [PATCH] update --- esxi-scripts/host-shutdown.ps1 | 7 +++++++ esxi-scripts/iscsi-server-shutdown.ps1 | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100755 esxi-scripts/host-shutdown.ps1 create mode 100755 esxi-scripts/iscsi-server-shutdown.ps1 diff --git a/esxi-scripts/host-shutdown.ps1 b/esxi-scripts/host-shutdown.ps1 new file mode 100755 index 00000000..07f53b67 --- /dev/null +++ b/esxi-scripts/host-shutdown.ps1 @@ -0,0 +1,7 @@ +#!/usr/bin/env pwsh + +. /opt/idssys/powerwall/settings.ps1 + +Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword + +Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false diff --git a/esxi-scripts/iscsi-server-shutdown.ps1 b/esxi-scripts/iscsi-server-shutdown.ps1 new file mode 100755 index 00000000..344fda6f --- /dev/null +++ b/esxi-scripts/iscsi-server-shutdown.ps1 @@ -0,0 +1,7 @@ +#!/usr/bin/env pwsh + +. /opt/idssys/powerwall/settings.ps1 + +Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword + +Get-VM | Where {$_.Name -like '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false