16 lines
527 B
PowerShell
Executable File
16 lines
527 B
PowerShell
Executable File
#!/usr/bin/env pwsh
|
|
|
|
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
|
. /opt/idssys/powerwall/settings.ps1
|
|
|
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
|
|
|
$VMLIST = Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
|
|
|
|
Foreach ($VM in $VMLIST) {
|
|
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
|
|
Start-Sleep -Seconds 1
|
|
}
|
|
}
|
|
|
|
Disconnect-VIServer $ESXI -Confirm:$false |