Blog
Projects
About
Backtrack:
Blog
›
PowerCLI: handling snapshots
Comments
PowerCLI: handling snapshots
posted on September 9th 2019, at 12:45
by
lunarg
Handling snapshots (creating, deleting, restoring) is rather intuitive when you already have some experience with PowerCLI. As a reference, here are some one-liners. As always with Powershell, there's more than one way to achieve a goal... The examples used here assume a VM named "SRV01". Adjust as needed.
Create a snapshot:
Get-VM SRV01 | New-Snapshot -Name "My snapshot"
Remove all snapshots (disabling confirmation request in the process):
Get-VM SRV01 | Get-Snapshot | Remove-Snapshot -Confirm:$false
To handle a specific snapshot, you could do something like this:
$vm = Get-VM SRV01$snap = Get-Snapshot -VM $vm -Name "My snapshot"# do something with the sn
...
read more
add a comment
Tags
computer
windows
software
vmware
microsoft
linux
exchange
hardware
network
news
mac
powershell
home
office365
msoffice
ad
server
sqlserver
dell
soaring
esx
internet
mssql
rds
sbs
events
powercli
terminalserver
virtualization
antivirus
Archive
«
‹
November 2024
›
»
Sun
Mon
Tue
Wed
Thu
Fri
Sat
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
Links
-
@harkx
-
Cats & Dogs
-
Jargon-free Security Guide
Quote
«
Crude, but effective...
»
Seven Of Nine
Contact
© 2009-2024 Black Manticore – all rights reserved
code by
lunarg
, design by
SuriAmanah
, hosted at Cats&Dogs