From 5cac400ab9c5f8b734d9cb4729f5d1d5ed249ee7 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 15 May 2023 16:52:23 -0500 Subject: [PATCH] Create sys-suspend.ps1 --- esxi-scripts/sys-suspend.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 esxi-scripts/sys-suspend.ps1 diff --git a/esxi-scripts/sys-suspend.ps1 b/esxi-scripts/sys-suspend.ps1 new file mode 100755 index 00000000..6f4a1f7a --- /dev/null +++ b/esxi-scripts/sys-suspend.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 -like '*MySQL*' -and $_.Name -like '*PiHole*' -and $_.Name -like '*vCenter*'} | Suspend-VM