From ef41262d122fe813aa6f2734a46f0f016a1f58cd Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 30 Dec 2023 10:11:24 -0600 Subject: [PATCH] Update iscsi-sys-vm-shutdown-verify.ps1 --- esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 b/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 index ea4a5521..54fbe0b8 100755 --- a/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 +++ b/esxi-scripts/iscsi-sys-vm-shutdown-verify.ps1 @@ -1,23 +1,13 @@ #!/usr/bin/env pwsh -# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false +Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false . /opt/idssys/powerwall/settings.ps1 $ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword -# $VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM -# -# Foreach ($VM in $VMLIST) { -# while((Get-VM $VM).PowerState -ne 'PoweredOff') { -# Start-Sleep -Seconds 1 -# } -# } - Do { $VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM - write-host $VMLIST if ($VMLIST -ne $null) { - write-host "cycling through iscsi vms found" $poff = 'no' Foreach ($VM in $VMLIST) { $VMI = Get-VM $VM @@ -29,13 +19,8 @@ Do { } } } else { - write-host "no iscsi vms found" $poff = 'yes' } } Until ($poff -match 'yes') - - - - Disconnect-VIServer $ESXI -Confirm:$false \ No newline at end of file