Update iscsi-sys-vm-shutdown-verify.ps1

This commit is contained in:
2023-12-30 09:40:15 -06:00
parent 586df3160f
commit 6f64defa7d

View File

@@ -20,7 +20,9 @@ Do {
write-host "cycling through iscsi vms found" write-host "cycling through iscsi vms found"
$poff = 'no' $poff = 'no'
Foreach ($VM in $VMLIST) { Foreach ($VM in $VMLIST) {
if ((Get-VM $VM).PowerState -match 'PoweredOn') { if ((Get-VM $VM) -eq $null) {
break
} elseif ((Get-VM $VM).PowerState -match 'PoweredOn') {
break break
} else { } else {
$poff = 'yes' $poff = 'yes'