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

This commit is contained in:
2023-12-30 09:45:02 -06:00
parent 6f64defa7d
commit 7fd8d702e8

View File

@@ -20,9 +20,8 @@ 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) -eq $null) { $VMI = Get-VM $VM
break if ($VMI -eq $null -Or $VMI.PowerState -match 'PoweredOn') {
} elseif ((Get-VM $VM).PowerState -match 'PoweredOn') {
break break
} else { } else {
$poff = 'yes' $poff = 'yes'