Created
October 7, 2015 21:23
-
-
Save jonathanelbailey/ca6f2799593f3d1980ef to your computer and use it in GitHub Desktop.
A set of functions that create a Virtual Machine and its VHD.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-RdpVmConfig{ | |
Param( $Name, | |
$SwitchName, | |
$VhdPath, | |
$Path ) | |
BEGIN{} | |
PROCESS{ | |
New-VM -Name $Name -MemoryStartupBytes 2048 -BootDevice VHD -SwitchName $SwitchName -VHDPath $VhdPath -Path $Path -Generation 1 | |
Set-VM -Name $Name -ProcessorCount 4 -DynamicMemory $true -MemoryMinimumBytes 2048 | |
Enable-VMIntegrationService -VMName $Name | |
} | |
END{ | |
$Result = get-vm -Name $Name | |
Write-Output $Result | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment