update
This commit is contained in:
17
esxi-scripts/iscsi-vm-shutdown-verify.ps1
Executable file
17
esxi-scripts/iscsi-vm-shutdown-verify.ps1
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
. /opt/idssys/powerwall/settings.ps1
|
||||
|
||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
|
||||
|
||||
Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
|
||||
Try{
|
||||
$vm = Get-VM -Name $vmName -ErrorAction Stop
|
||||
switch($vm.PowerState){
|
||||
'poweredon' {
|
||||
sleep 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user