This commit is contained in:
2024-01-27 20:42:44 -06:00
parent e04eb50604
commit 9b116603e0
9 changed files with 36 additions and 47 deletions

View File

@@ -1,9 +1,7 @@
#!/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
Do {
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-*'} | Get-VM
@@ -28,4 +26,4 @@ Do {
} Until ($poff -match 'yes')
Disconnect-VIServer -Server $args[0] -Force Confirm:$false
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false

View File

@@ -1,10 +1,8 @@
#!/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-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 $args[0] -Force Confirm:$false
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false

View File

@@ -1,9 +1,7 @@
#!/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
Do {
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM
@@ -28,4 +26,4 @@ Do {
} Until ($poff -match 'yes')
Disconnect-VIServer -Server $args[0] -Force Confirm:$false
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false

View File

@@ -1,10 +1,8 @@
#!/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-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
Disconnect-VIServer -Server $args[0] -Force Confirm:$false
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false

View File

@@ -1,9 +1,7 @@
#!/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
Do {
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM
@@ -28,4 +26,4 @@ Do {
} Until ($poff -match 'yes')
Disconnect-VIServer -Server $args[0] -Force Confirm:$false
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false

View File

@@ -1,10 +1,8 @@
#!/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-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
Disconnect-VIServer -Server $args[0] -Force Confirm:$false
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false