Last active
November 15, 2016 17:34
-
-
Save ChabaOk/0b84a9749c13cc33d067cb7af06f463a to your computer and use it in GitHub Desktop.
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
$sw = [Diagnostics.Stopwatch]::StartNew() | |
Import-Module -Name C:\temp\NanoServer\NanoServerImageGenerator | |
# Prepare password as secure string | |
$secAdminPassword = ("Passw0rd"|ConvertTo-SecureString -AsPlainText -Force) | |
# Create Nano image | |
New-NanoServerImage -MediaPath C:\temp -BasePath .\ -DeploymentType Guest -Edition Standard -TargetPath "c:\temp\NanoVM\vmNanoStorage.vhdx" -AdministratorPassword $secAdminPassword -MaxSize 10GB -storage -ComputerName Nano | |
# Create VM | |
$strVM = "Nano" | |
New-VM -VHDPath c:\temp\nanovm\vmnanostorage.vhdx -MemoryStartupBytes 512MB -Name $strVM -Generation 2 | |
Set-VMProcessor -VMName $strVM -Count 1 | |
$sw.Stop() | |
$sw.Elapsed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment