Update get-snapshots.ps1
This commit is contained in:
@@ -1,15 +1,17 @@
|
|||||||
#!/usr/bin/env pwsh
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
Write-Progress -Activity "Connecting to vCenter..." -Completed
|
Write-Progress -Activity "Connecting to vCenter..." -PercentComplete 20
|
||||||
|
|
||||||
. /opt/idssys/powerwall/settings.ps1
|
. /opt/idssys/powerwall/settings.ps1
|
||||||
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
||||||
|
|
||||||
Write-Progress -Activity "Gathering Snapshots..." -Completed
|
Write-Progress -Activity "Gathering Snapshots..." -PercentComplete 80
|
||||||
|
|
||||||
$snapshots = get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb
|
$snapshots = get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb
|
||||||
# get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue
|
# get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue
|
||||||
|
|
||||||
Write-Progress -Activity $snapshots
|
Write-Progress -Completed
|
||||||
|
|
||||||
|
write-host "$snapshots"
|
||||||
|
|
||||||
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|
||||||
|
|||||||
Reference in New Issue
Block a user