MOCs
- Overview
- Tips and Tricks
- Installing Hyper-V
- Virtual Machine Management
- Virtual Hard Disk Management
- Virtual Network Management
- Snapshot Management
- Checking Hyper-V Status
Overview
Hyper-V is Microsoft’s hardware virtualization product. It lets you create and run a software version of a computer, called a virtual machine. PowerShell provides a command-line shell and scripting language to automate tasks for Hyper-V management.
Documentation
Documenation
PowerShell docs
My HyperV Powershell code
Tips and Tricks
- Exporting a VM:
- Importing a VM:
- Configuring VM Automatic Start and Stop Actions:
Installing Hyper-V
Hyper-V can be installed on Windows Server and some editions of Windows 10 and Windows 11. Use the following PowerShell command to install Hyper-V on your system:
Virtual Machine Management
- Creating a New Virtual Machine:
- Starting a Virtual Machine:
- Stopping a Virtual Machine:
Virtual Hard Disk Management
- Creating a New Virtual Hard Disk:
- Attaching a Virtual Hard Disk to a VM:
Virtual Network Management
- Creating a Virtual Switch:
- Listing Virtual Switches:
Snapshot Management
- Creating a Snapshot (Checkpoint):
- Restoring a Snapshot (Checkpoint):
Checking Hyper-V Status
- List All VMs and Their Status:
- Check Hyper-V Feature Status: