Using PowerCLI to take a snapshot of your virtual machine

It is common to take a snapshot of your VM before performing any changes. Instead of logging into vSphere and taking a snapshot of each machine with the vSphere interface I use PowerCLI to take a snapshot. The commands below are what I use to create snapshots. The last part of the line has a -name "Ticket Number 12345 - Created by John Impallomeni" which is really just a comment that you can see attached to your snapshot. You can replace this text with whatever makes sense for you. For me, it is easiest to reference a ticket number and also put my name on it so if anyone has any questions they can come to me or look up the ticket if I am not available.

Take a snapshot of single VM New-Snapshot -vm server1 -Memory:$false -confirm:$false -name "Ticket number 12345 - Created by John Impallomeni"

Take a snapshot of multiple VMs New-Snapshot -vm server1,server2,server3 -Memory:$false -confirm:$false -name "Ticket number 12345 - Created by John Impallomeni"

Try it on a test machine first to make sure it works in your environment.

Happy snapshotting!