Create VMWare Snapshot - PowerShell/PowerCLI - How?

Hi - I'm losing my mind trying to figure this out - any help would be great!

I want to run some PowerShell/PowerCLI steps/commands/installs - whatever - to take a VM snapshot prior to deploying Windows OS Update pakages.

I can run a PowerShell script on the target machine manually and it works. 
The script, basically does this:


Import-module vmware.viautomation.core

$Credentials = Get-VICredentialStoreItem - host myvCentre -file <mycredential.xml>

Connect-VIServer -Server myvCentre -user $Credential.user -password $Credential.password

New-Snapshot -VM hostname -Name "Pre-Update Snapshot" -Description "whatever...."


Question - what's the proper way to do this - have the XML and ps1 script already on the target computers and my PDQ step is execute the remote script - or - bake these commands into a PDQ script in PDQ Deploy.






Please sign in to leave a comment.

Didn't find what you were looking for?

New post