11 lines
465 B
PowerShell
Executable File
11 lines
465 B
PowerShell
Executable File
#!/usr/bin/env pwsh
|
|
|
|
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
|
|
. /opt/idssys/powerwall/settings.ps1
|
|
|
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
|
|
|
Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
|
|
|
|
Disconnect-VIServer $ESXI -Confirm:$false
|