#!/usr/bin/env pwsh . /opt/idssys/powerwall/conf/settings.ps1 Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null Get-Datastore | Where {$_.Name -like '*iSCSI-*' -and $_.Name -notlike '*vMS*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI-*'} | Shutdown-VMGuest -Confirm:$false Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false