update
This commit is contained in:
@@ -1,22 +1,17 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.Name -like '*iSCSI-*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
|
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-*'} | Get-VM
|
||||||
Try{
|
|
||||||
$vm = Get-VM -Name $vmName -ErrorAction Stop
|
Foreach ($VM in $VMLIST) {
|
||||||
switch($vm.PowerState){
|
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
|
||||||
'poweredon' {
|
write-host waiting
|
||||||
sleep 5
|
Start-Sleep -Seconds 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
Catch{
|
|
||||||
Write-Host "VM '$($vmName)' not found!"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
|
|
||||||
@@ -1,21 +1,17 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
|
$VMLIST = Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM
|
||||||
Try{
|
|
||||||
$vm = Get-VM -Name $vmName -ErrorAction Stop
|
Foreach ($VM in $VMLIST) {
|
||||||
switch($vm.PowerState){
|
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
|
||||||
'poweredon' {
|
write-host waiting
|
||||||
sleep 5
|
Start-Sleep -Seconds 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
Catch{
|
|
||||||
Write-Host "VM '$($vmName)' not found!"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
# Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
|
|
||||||
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
$ESXI = Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
|
||||||
|
|
||||||
Get-Datastore | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Get-VM | if ($_.PowerState -eq "PoweredOn") {
|
$VMLIST = Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
|
||||||
Try{
|
|
||||||
$vm = Get-VM -Name $vmName -ErrorAction Stop
|
Foreach ($VM in $VMLIST) {
|
||||||
switch($vm.PowerState){
|
while((Get-VM $VM).PowerState -ne 'PoweredOff') {
|
||||||
'poweredon' {
|
write-host waiting
|
||||||
sleep 5
|
Start-Sleep -Seconds 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
Catch{
|
|
||||||
Write-Host "VM '$($vmName)' not found!"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0
|
Disconnect-VIServer $ESXI -Confirm:$false
|
||||||
|
|
||||||
Reference in New Issue
Block a user