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

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

May 31, 2026
WordPress Security Hardening Checklist: 34 Scored Controls with Copy-Paste Fixes - cover image

WordPress Security Hardening Checklist: 34 Scored Controls with Copy-Paste Fixes

June 3, 2026
Maximizing Website Speed with Image Optimization Techniques for 2026 - cover image

Maximizing Website Speed with Image Optimization Techniques for 2026

June 3, 2026
SSL certificate renewal manager - 8 ACME clients, expiry calculator and monitoring - cover image

SSL Certificate Renewal Manager: certbot, acme.sh, lego, Caddy, cert-manager

June 3, 2026
CORS policy generator - 14 server and framework configs with presets and live security review - cover image

CORS Policy Generator: Headers + Nginx, Apache, Express, FastAPI, Django Config

June 3, 2026
netsh wlan command reference - 72 commands with example output and copy - cover image

netsh wlan Commands: Windows Wi-Fi Cheat Sheet (Show Password, Profiles, Hotspot)

June 2, 2026
Fix: ESXi Host Not Responding / Disconnected in vCenter (2026) - cover image

Fix: ESXi Host Not Responding / Disconnected in vCenter (2026)

June 1, 2026
VMware ESXi Purple Screen of Death (PSOD): Diagnose and Recover (2026) - cover image

VMware ESXi Purple Screen of Death (PSOD): Diagnose and Recover (2026)

June 1, 2026
VMware PowerCLI command generator cover

VMware PowerCLI Command Generator: VM, Snapshots, Networking, esxcli

June 1, 2026
dd Command Generator: Write ISO to USB, Image Disks, Wipe Drives - cover image

dd Command Generator: Write ISO to USB, Image Disks, Wipe Drives

June 1, 2026
SSH Tunnel Command Generator: Local, Remote and Dynamic Forwarding - cover image

SSH Tunnel Command Generator: Local, Remote and Dynamic Forwarding

June 1, 2026
sed Command Generator: Build Substitute, Delete and Print Commands - cover image

sed Command Generator: Build Substitute, Delete and Print Commands

May 31, 2026
VMware Workstation and Hyper-V on the Same Machine (2026 Fix) - cover image

VMware Workstation and Hyper-V on the Same Machine (2026 Fix)

May 31, 2026
  • Online Tools
  • Network Tools
  • Developer Tools
  • Security Tools
Wednesday, June 3, 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
May 31, 2026
in Online Tools, Server Tools
0
Hyper-V PowerShell generator cover
0
SHARES
5
VIEWS
Share on FacebookShare on Twitter

Hyper-V PowerShell generator

Generate the PowerShell to create a Hyper-V VM, build virtual switches or manage checkpoints — without memorising every parameter of New-VM and Set-VMProcessor. Pick the options and copy a ready-to-run script, with each cmdlet explained. Great companion to the CTF lab build. Generated entirely in your browser.

Generates the three switch types. Edit names and the physical NIC to match your host.

What this Hyper-V PowerShell generator does

Creating a Hyper-V VM in the GUI is fine for one machine, but the moment you want a repeatable, scriptable lab you switch to PowerShell. The trouble is that a complete VM build is not one cmdlet: it is New-VM for the shell, Set-VM and Set-VMProcessor for CPU and memory, Set-VMFirmware for Secure Boot and boot order, Add-VMDvdDrive for the install ISO, and finally Start-VM. This generator assembles that whole sequence from a few choices so you copy a script that runs top to bottom, and it explains what each line does.

It also covers the two other things you script constantly around a lab: the three virtual switch types (External, Internal, Private) that define your network isolation, and checkpoint management for clean revert points. These mirror the workflow in the CTF lab on Hyper-V walkthrough.

Why script Hyper-V instead of clicking

  • Reproducibility. A script rebuilds the exact same VM after you blow one away, which you do constantly in a lab.
  • Speed. Standing up five VMs is a loop, not twenty minutes of wizard clicks.
  • Documentation. The script is the record of how the VM was built, version-controllable alongside the rest of your infrastructure.
  • Consistency. Every lab VM gets the same Secure Boot, memory and switch settings, removing the “works on that VM only” class of problem.

The cmdlets behind a VM build

CmdletRole
New-VMCreates the VM, its generation, startup memory, a new or existing VHDX, and attaches a switch.
Set-VMSets processor count and Dynamic Memory bounds after creation.
Set-VMFirmwareGeneration 2 only: toggles Secure Boot and sets the first boot device.
Set-VMProcessorExposes virtualization extensions for nested virtualization.
Add-VMDvdDriveAttaches an install ISO so the VM can boot the installer.
Start-VM / Checkpoint-VMPowers the VM on; creates a named snapshot you can revert to.

Virtual switches and isolation

The switch type decides what a VM can reach. An External switch bridges a physical NIC, giving VMs real network and Internet access. An Internal switch connects the VMs and the host but not the wider network. A Private switch connects VMs to each other only, with no host or Internet path, which is the safe place for anything you do not fully trust. The switch mode of this generator outputs all three so you can pick and adapt.

Privacy and how this tool runs

The script is built by JavaScript in your browser. No VM names, paths or settings are sent anywhere or logged. You can use the generator offline once the page has loaded.

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", then set CPU with Set-VM -Name "lab" -ProcessorCount 2, adjust firmware with Set-VMFirmware, and finish with Start-VM. The generator assembles the whole sequence for you.

How do I disable Secure Boot for a Linux VM?

On a Generation 2 VM run Set-VMFirmware -VMName "lab" -EnableSecureBoot Off, or keep it on with the Linux template: -SecureBootTemplate MicrosoftUEFICertificateAuthority. Generation 1 VMs have no Secure Boot.

How do I enable nested virtualization?

With the VM off, run Set-VMProcessor -VMName "lab" -ExposeVirtualizationExtensions $true and disable Dynamic Memory for that VM. This lets you run Hyper-V, WSL2 or Docker inside the VM.

How do I create the three virtual switches?

New-VMSwitch -Name External -NetAdapterName "Ethernet" -AllowManagementOS $true for bridged, New-VMSwitch -Name Internal -SwitchType Internal for host-plus-VMs, and New-VMSwitch -Name Private -SwitchType Private for VM-only. Switch to the Virtual switches mode above to generate all three.

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

A production checkpoint uses the guest VSS to make an application-consistent snapshot, like a backup. A standard checkpoint captures the full machine state including memory, which is ideal for a lab revert point but not for production data integrity. Set the type with Set-VM -CheckpointType.

How do I revert a VM to a checkpoint?

Get-VMSnapshot -VMName "lab" lists them, then Restore-VMSnapshot -VMName "lab" -Name "clean-baseline" -Confirm:$false reverts. Take a checkpoint right after a clean install so every experiment starts from the same baseline.

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
  • All Tools and Articles
  • Contact
  • Cookie Policy
  • Hyper-V Hub: Tools, Error Fixes and Lab Guides
  • Linux Hub: Cross-Distro Reference, Articles, Tools
  • Page de test Codex
  • 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.