diff --git a/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 b/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 index be3c87b0..e3cf357a 100755 --- a/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 +++ b/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 @@ -15,14 +15,14 @@ $ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -P # } Do { - $poff = yes + $poff = 'yes' $VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM Foreach ($VM in $VMLIST) { - if ((Get-VM $VM).PowerState -eq 'PoweredOn') { - $poff = no + if ((Get-VM $VM).PowerState -match 'PoweredOn') { + $poff = 'no' } } -} Until ($poff -eq yes) +} Until ($poff -match 'yes')