This commit is contained in:
2024-01-31 10:17:34 -06:00
parent 579c3f213d
commit 2258aab1e3
2 changed files with 29 additions and 15 deletions

View File

@@ -1,10 +1,14 @@
#!/usr/bin/env pwsh
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
. /opt/idssys/powerwall/settings.ps1
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
#Get-VMHost | Where {$args[0]} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
Disconnect-VIServer -Server $args[0] -Force Confirm:$false
Get-VMHost | Where {$args[0]} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false
#$_.Name -eq 'ids-vms1.scity.us' -or $_.Name -eq 'ids-vms7.scity.us'