← script library

Hyper-V VM Snapshot Script

Hyper-VJanuary 10, 2025

This PowerShell script creates snapshots of your Hyper-V virtual machines, allowing for easy rollbacks and recovery points. Regular snapshots can significantly ease the management of your VMs.

powershell
Import-Module Hyper-V

$vmName = "YourVMName"

Checkpoint-VM -VMName $vmName -SnapshotName "Snapshot created on $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"

Get-VMSnapshot -VMName $vmName | Format-Table -Property Name, CreationTime

Run it across your fleet

This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.

Ready when you are.

Try ServerEngine free for 7 days.