diff --git a/esxi-scripts/offsite-vm-shutdown.ps1 b/esxi-scripts/offsite-vm-shutdown.ps1 index 42011eec..3081e16e 100755 --- a/esxi-scripts/offsite-vm-shutdown.ps1 +++ b/esxi-scripts/offsite-vm-shutdown.ps1 @@ -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)