liveBook · Manning

New-VM

As explained in Practical Automation with PowerShell: Effective scripting from the console to the cloud

New-VM is a Hyper-V PowerShell cmdlet that creates a virtual machine with specified configuration and storage settings.

New-VM creates a Hyper-V virtual machine after the automation determines its host, storage path, virtual switch, generation, and virtual disk settings. section 10.6

Idempotent VM creation

A rerunnable script uses Get-VM to detect an existing machine, calls New-VM only when absent, and applies later settings to either newly created or existing VMs.

How Practical Automation with PowerShell: Effective scripting from the console to the cloud covers it

How deep it goes
Explains parameter construction, validation, conditional creation, and follow-up configuration, but not cmdlet internals.
Examples
Uses a Generation 2 VM with a 40GB VHDX, selected switch, attached ISO, configured memory, and DVD-first boot order.
What it assumes
Assumes PowerShell and Hyper-V administration familiarity while demonstrating storage, switch, and VM existence checks.
What you can do after
Build it from scratch and rerun it safely by creating only missing virtual machines and continuing configuration.
How it connects
Connects virtual machines with Hyper-V hosts, virtual switches, virtual hard disks, dynamic memory, checkpoints, ISO media, and boot firmware.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Practical Automation with PowerShell: Effective scripting from the console to the cloud. The section links point to the parts of the book it draws on.