Skip to content

Instantly share code, notes, and snippets.

@masters274
masters274 / vmSnap.ps1
Last active April 29, 2025 15:36
PowerShell Universal - Virtual Machine Manager
<# SETUP
TODO: You're gonna need a couple of modules for this code to work. I suggest installing them at the system level instead of user.
Install-Module -Name @('VMWare.PowerCLI', 'Core') -Force
TODO: Need to setup the credential object after the Core module is installed. Don't worry, it's encrypted, and only works for your user, on the local
computer. i.e. it's not portable. You'll need to setup a new file if your change which user PSU is ran as, or if you put it on a different computer. This needs to be completed before the first run, otherwise it will make a blank file and throw errors.
YOU MUST RUN THE FOLLOWING COMMAND AS THE SERVICE ACCOUNT THAT WILL RUN PSU, AND ON THE SERVER IT WILL BE RAN ON!!!