• Latest
  • Trending
  • All
Hyper-V PowerShell generator cover

Hyper-V PowerShell Generator: New-VM, Virtual Switches, Checkpoints

June 14, 2026
ssh command cheatsheet

SSH Command Cheatsheet: Connect, Keys, scp, Tunnels (2026)

June 16, 2026
chmod-chown-cheatsheet

chmod and chown Cheatsheet: Linux Permissions, Decoded (2026)

June 16, 2026
systemctl-journalctl-cheatsheet

systemctl + journalctl Cheatsheet: Services and Logs (2026)

June 16, 2026
grep-cheatsheet

The grep Cheatsheet: Search a File, Search a Tree (2026)

June 16, 2026
rsync-cheatsheet

The rsync Cheatsheet: Mirror, Sync, Copy Over SSH (2026)

June 16, 2026
curl-cheatsheet

curl Cheatsheet: Download Files and Test APIs (2026)

June 16, 2026
iptables-vs-nftables-cheatsheet cheatsheet

iptables vs nftables: Linux Firewall Cheatsheet, Side by Side

June 16, 2026
nmcli-cheatsheet cheatsheet

nmcli Cheatsheet: Wi-Fi and Network Connections From the Linux Terminal

June 16, 2026
powershell-networking-cheatsheet cheatsheet

PowerShell Networking Cheatsheet: Test-NetConnection, IP, DNS (2026)

June 16, 2026
tar command cheatsheet

The tar Command Cheatsheet: Create, Extract, Stop Guessing (2026)

June 16, 2026
Linux find command cheatsheet

The find Command Cheatsheet: Every Recipe You Actually Use (2026)

June 15, 2026
Linux networking commands cheatsheet, ip and ss

Linux Networking Commands in 2026: the ip and ss Cheatsheet

June 15, 2026
  • Online Tools
  • Network Tools
  • Developer Tools
  • Security Tools
Tuesday, June 16, 2026
  • Login
People Are Geek
  • Online Tools
  • Network Tools
  • Developer Tools
  • Security Tools
No Result
View All Result
People Are Geek
No Result
View All Result
Home Online Tools

Hyper-V PowerShell Generator: New-VM, Virtual Switches, Checkpoints

by People Are Geek
June 14, 2026
in Online Tools, Server Tools
0
Hyper-V PowerShell generator cover
0
SHARES
10
VIEWS
Share on FacebookShare on Twitter

Hyper-V PowerShell generator

Nobody memorizes every flag on New-VM. I gave up pretending I do. So this thing exists. Tick a few boxes and you get a Hyper-V script you can paste straight in, spin up a VM, wire up virtual switches, fiddle with checkpoints, and every line carries a little note on what it’s for. Honestly, I reach for it most when I’m throwing together a CTF lab and can’t be bothered to type it all. It runs in your browser. Nothing you type leaves the page.

All three switch types, right here. Swap in your own names first. And put the real NIC from your host in before you run anything, or the External one just won’t bind.

Recommended homelab gearWe may earn a commission, at no extra cost to you.
Mini Pc HomelabCheck price on Amazon →Nas EnclosureCheck price on Amazon →Ups Battery BackupCheck price on Amazon →2.5 Sata SsdCheck price on Amazon →

What this Hyper-V PowerShell generator does

Clicking through Hyper-V Manager is fine for one machine you’ll never touch again. Fine, sure. But the moment I want a lab I can tear down and rebuild on a whim, I’m back in PowerShell. And here’s the part nobody mentions: a real VM build is never one command. You’ve got New-VM for the shell. Then Set-VM and Set-VMProcessor for CPU and memory, Set-VMFirmware for Secure Boot and boot order, maybe Add-VMDvdDrive if there’s an ISO, and finally Start-VM to light it up. This tool stitches that whole mess together from whatever you tick, hands you a script that runs end to end, and tells you what every line is doing.

The other two things I end up scripting on repeat are here as well. The switch types (External, Internal, Private) that decide how boxed-in each VM is. And checkpoints, so there’s always a clean spot to roll back to when an experiment goes sideways. Same flow I walk through in the CTF lab on Hyper-V guide.

Why script Hyper-V instead of clicking

  • Reproducibility. I nuke VMs constantly. The script rebuilds the same one in seconds, and I never sit there wondering what I picked last time.
  • Speed. Five VMs? That’s a loop. The same thing in the wizard is twenty minutes I’m not getting back.
  • Documentation. The script is the record of how that VM got built. Drop it in git beside the rest of your infra and future-you will be grateful.
  • Consistency. Same Secure Boot and memory and switch on every box, every time. Kills the “but it works on that one VM” headache before it even starts.

The cmdlets behind a VM build

CmdletRole
New-VMThe starting point: sets the generation and startup memory, points at a fresh or existing VHDX, and hooks up a switch.
Set-VMOnce the VM exists, this is where I set the vCPU count and the Dynamic Memory floor and ceiling.
Set-VMFirmwareGen 2 only. Flips Secure Boot on or off and decides what the VM boots from first.
Set-VMProcessorExposes the virtualization extensions so you can run a hypervisor inside the VM (nested).
Add-VMDvdDriveBolts an install ISO onto the VM so it has something to boot the installer from.
Start-VM / Checkpoint-VMOne powers the box on; the other snaps a named checkpoint you can jump back to later.

Virtual switches and isolation

The switch type decides how far a VM can reach. That’s the whole game. An External switch bridges a physical NIC, so your VMs get a real network and a path out to the Internet. An Internal switch lets the host and the VMs chat among themselves and nothing past your box. A Private switch is stricter still: VMs talk only to each other, no host, no Internet, nowhere to phone home. That last one is where I dump anything I don’t trust. Malware samples, a target I’m poking at, that sort of thing. The switch mode here writes all three and you delete the lines you don’t want.

Privacy and how this tool runs

The script-building runs in JavaScript, right in your browser. Your VM names and paths and settings? None of it gets sent anywhere or logged. Once the page is loaded you can yank your network cable and it keeps working.

Frequently asked questions

How do I create a Hyper-V VM in PowerShell?

Start with New-VM -Name "lab" -Generation 2 -MemoryStartupBytes 4GB -NewVHDPath "D:\VMs\lab.vhdx" -NewVHDSizeBytes 60GB -SwitchName "Internal". That’s the shell. Then hand it cores with Set-VM -Name "lab" -ProcessorCount 2, sort the firmware out with Set-VMFirmware, and Start-VM to boot. Don’t fancy typing all that? The generator above writes the full chain.

How do I disable Secure Boot for a Linux VM?

Most Linux ISOs choke on Secure Boot. So on a Gen 2 VM I just kill it: Set-VMFirmware -VMName "lab" -EnableSecureBoot Off. Want to keep it on? Point it at the Linux template with -SecureBootTemplate MicrosoftUEFICertificateAuthority and most modern distros stop complaining. Gen 1 VMs have no Secure Boot in the first place, so nothing to toggle there.

How do I enable nested virtualization?

Shut the VM down first. This won’t take on a running machine, learned that the annoying way. Then run Set-VMProcessor -VMName "lab" -ExposeVirtualizationExtensions $true and switch off Dynamic Memory for it. Now you can run Hyper-V, WSL2 or Docker inside the VM. It’s how I spin up a throwaway hypervisor and never touch the host.

How do I create the three virtual switches?

Three one-liners, done. New-VMSwitch -Name External -NetAdapterName "Ethernet" -AllowManagementOS $true bridges your NIC. New-VMSwitch -Name Internal -SwitchType Internal gives you host-plus-VMs. And New-VMSwitch -Name Private -SwitchType Private locks it to VMs only. Flip to Virtual switches mode up top and it writes all three at once, ready to tweak.

What is the difference between a standard and a production checkpoint?

Not the same thing, and the gap bites people. A production checkpoint leans on the guest’s VSS for an application-consistent snapshot. Basically a proper backup, so databases and the like stay clean. A standard checkpoint grabs the whole machine state, memory included, so you land back exactly where you were. Great for a lab. Not what you want for live data, honestly, though I might be over-cautious there. Pick one with Set-VM -CheckpointType.

How do I revert a VM to a checkpoint?

List what you’ve got with Get-VMSnapshot -VMName "lab". Then roll it back with Restore-VMSnapshot -VMName "lab" -Name "clean-baseline" -Confirm:$false. The habit that saves me over and over: snap a checkpoint the second a fresh install finishes. Every experiment after that starts from the same clean slate, no rebuilding from scratch.

Sources & further reading

  • Microsoft Learn, Hyper-V PowerShell module reference
  • Microsoft Learn, Hyper-V on Windows Server overview

Related tools and resources

Hyper-V Error Reference CTF Lab on Hyper-V systemd Service Generator Common Ports List chmod Calculator
ShareTweetPin
People Are Geek

People Are Geek

I'm Stephane, a network and systems engineer with over 15 years of hands-on experience on production infrastructure, virtualization (ESXi, Proxmox), networking, and self-hosting. Earlier in my career I built and ran a Linux resource site that became a well-known reference for sysadmins. Today I focus on cybersecurity, and I also work as a technical trainer, teaching networking and security to people who do it for a living. Everything on People Are Geek comes from real-world practice, not theory. I build every tool on this site myself, and I write about what I've actually deployed, broken, and fixed. If it's here, I've used it.

People Are Geek

Copyright © 2017 JNews.

Navigate Site

  • About PeopleAreGeek
  • Affiliate Disclosure
  • All Tools and Articles
  • Contact
  • Cookie Policy
  • Hyper-V Hub: Tools, Error Fixes and Lab Guides
  • Linux Hub: Cross-Distro Reference, Articles, Tools
  • Privacy Policy
  • Sample Page
  • Terms of Service
  • VMware vSphere & ESXi Hub: Tools, Error Fixes and Guides

Follow Us

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Online Tools
  • Network Tools
  • Developer Tools
  • Security Tools

Copyright © 2017 JNews.