Files
powerwall/esxi-scripts/iscsi-vm-shutdown-verify.ps1

15 lines
388 B
PowerShell
Executable File

#!/usr/bin/env pwsh
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
. /opt/idssys/powerwall/settings.ps1
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM
Foreach ($VM in $VMLIST) {
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
write-host waiting
Start-Sleep -Seconds 1
}
}
Disconnect-VIServer $ESXI -Confirm:$false