Skip to content

Instantly share code, notes, and snippets.

@ChabaOk
Last active Nov 15, 2016
Embed
What would you like to do?
$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