Skip to content

Instantly share code, notes, and snippets.

@ChabaOk
Last active November 15, 2016 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChabaOk/0b84a9749c13cc33d067cb7af06f463a to your computer and use it in GitHub Desktop.
Save ChabaOk/0b84a9749c13cc33d067cb7af06f463a to your computer and use it in GitHub Desktop.
$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