#!/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 | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false