GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — PowerCLI-Example-Scripts/Scripts/vCenterSnapshot.ps1 at master · vmware-archive/PowerCLI-Example-Scripts

This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Expand file tree

/

vCenterSnapshot.ps1

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
40 lines (31 loc) · 1.25 KB
/

vCenterSnapshot.ps1

Copy path

File metadata and controls

40 lines (31 loc) · 1.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<#
.NOTES
Script name: vCenterSnapshot.ps1
Created on: 20/09/2017
Author: Lukas Winn, @lukaswinn
Dependencies: Password is set to VMware123 in my test environment but this can be changed.
.DESCRIPTION
Script to retrieve snapshot information for all VM's in a given vCenter
#>
Write-Host "`nGet VM Snapshot Information!"
Write-Host "Copyright 2017 Lukas Winn / @lukaswinn"
Write-Host "Version 1.0" "`n"
$vCenter = Read-Host -prompt 'Enter FQDN / IP address of vCenter'
if ($vCenter) {
$vcUser = Read-Host -prompt 'Username'
Write-Host 'vCenter:' $vCenter ''
# Connect to vCenter with $vCenter variable value
Connect-VIServer -Server $vCenter -User $vcUser -Password VMware123
Write-Host "`nConnected to vCenter: " $vCenter
Write-Host 'Retrieving snapshot information...'
Write-Progress -Activity 'Working...'
# Get VM snapshot information and output in table format
$getSnap = Get-VM | Get-Snapshot | sort SizeGB -descending | Select VM, Name, Created, @{Label="Size";Expression={"{0:N2} GB" -f ($_.SizeGB)}}, Id
$getSnap | Format-Table | Out-Default
# Close connection to active vCenter
Disconnect-VIServer $vCenter -Confirm:$false
Write-Host 'Connection closed to' $vCenter
}
else {
Write-Warning "Error: No data entered for vCenter!"
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.