This commit is contained in:
2023-05-07 18:46:27 -05:00
parent 26a1878fdc
commit d02f64fe4d
2 changed files with 14 additions and 0 deletions

7
esxi-scripts/host-shutdown.ps1 Executable file
View File

@@ -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

View File

@@ -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