Files
powerwall/esxi-scripts/host-maintenance_mode.ps1
2023-12-30 10:46:04 -06:00

11 lines
362 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 $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
Get-VMHost -Name $args[0] | set-vmhost -State Maintenance
Disconnect-VIServer $ESXI -Confirm:$false