Managing Hyper-V virtual machines efficiently is crucial for maintaining a productive environment. In this post, we'll share a useful PowerShell script that helps to create, list, and remove snapshots of Hyper-V virtual machines. This script can simplify your VM management tasks and enhance the way you handle backups and recovery points. Before we begin, ensure you have the necessary permissions to run these commands in your Hyper-V environment.
powershell
$VMName = 'YourVirtualMachineName'
$SnapshotName = 'Snapshot_' + (Get-Date -Format 'yyyyMMdd_HHmmss')
Checkpoint-VM -Name $VMName -SnapshotName $SnapshotName
Write-Host "Snapshot '$SnapshotName' created for VM '$VMName'"
$Snapshots = Get-VMCheckpoint -VMName $VMName
if ($Snapshots) {
$Snapshots | ForEach-Object {
Write-Host "Snapshot Name: $($_.Name) - Created on: $($_.CreationTime)"
}
} else {
Write-Host "No snapshots found for VM '$VMName'."
}
$SnapshotToRemove = 'Snapshot_YourNameToRemove'
Remove-VMCheckpoint -VMName $VMName -Name $SnapshotToRemove
Write-Host "Snapshot '$SnapshotToRemove' removed successfully from VM '$VMName'."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.
More in Hyper-V
Create a Hyper-V Checkpoint with PowerShell
2026-08-17Delete Old Hyper-V Checkpoints with PowerShell
2026-08-17Start a Hyper-V VM with PowerShell
2026-08-17Shut Down a Hyper-V VM with PowerShell
2026-08-17Efficient Hyper-V VM Status Reporting Script
2025-01-10Automated Virtual Machine Restart with PowerShell and Hyper-V
2025-01-10Ready when you are.
Try ServerEngine free for 7 days.