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

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