38 users online | 38 Guests and 0 Registered

How to create a Hyper-V VM in Powershell


New-VM -Name

New-VM -Path C:\VirtualMachines -MemoryStartupBytes 2GB

New-VHD -Path C:\VirtualMachines\New-VM.vhdx -SizeBytes 20GB -Dynamic

Add-VMHardDiskDrive -VMName New-VM -Path C:\VirtualMachines\New-VM.vhdx

Set-VMDvdDrive -VMName New-VM -ControllerNumber 1 -Path C:\ISOFiles\WindowsServer.iso

Get-VM "New-VM" | Get-VMNetworkAdapter -Name "Network Adapter" | Connect-VMNetworkAdapter -SwitchName "External / Internal Switch"

Start-VM -Name New-VM

Tags: hyper-v, hyperv, microsoft
Last update:
2017-06-28 15:59
Author:
Steve
Revision:
1.0
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.