Create VM snapshot via powershell new-ntnxsnapshot - noob alert

  • 21 December 2018
  • 1 reply


Totally new to powershell, so forgive my newbieness.

I've figured out how list and restore from snapshots, but I'm stuck on the required syntax for creating a new snapshot. I understand in need to provide the -SnapshotSpecs, but not really sure what I put after that, and what format it should be in.

I've tried:

New-NTNXSnapshot -SnapshotSpecs -vmuuid 0e78273b-b103-46e4-893c-04c933ede7cb -snapshotname testsnap

But obviously it's failing. I've managed to figure out the other functions by reviewing some other example PS scripts, but cannot find anything that aids with this one.

Hoping somebody can point me in the right direction.



1 reply

Figured it out after find a couple of other examples. Posting incase anybody else ever comes across this...was not easy to find these details via googling...

$snap = new-ntnxobject -Name SnapshotSpecDTO
$snap.vmuuid = "0e78273b-b103-46e4-893c-04c933ede7cb"
$snap.snapshotname = "PStest"

New-NTNXSnapshot -SnapshotSpecs $snap

Imagine for experienced powershell folks it's a no brainer, but for a noob...not so much 😉