Update offsite-vm-shutdown.ps1

This commit is contained in:
2024-02-05 22:45:55 -06:00
parent da63b1a0aa
commit 75f291b86c

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env pwsh
. /opt/idssys/powerwall/settings.ps1
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
Connect-VIServer -Force -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
Foreach ($vm in $vms)