code comments yo

This commit is contained in:
Megan Marsh 2018-12-20 13:09:32 -08:00
parent 24d2cc34e5
commit f26051a7da
1 changed files with 4 additions and 1 deletions

View File

@ -243,6 +243,7 @@ func getCreateVMScript(vmName string, path string, harddrivePath string, ram int
vhdx = vmName + ".vhd"
}
// Create VHD
templateString := `$vhdPath = Join-Path -Path {{ .Path }} -ChildPath {{ .VHDX }}` + "\n"
if harddrivePath != "" {
if diffDisks {
@ -252,13 +253,15 @@ func getCreateVMScript(vmName string, path string, harddrivePath string, ram int
}
} else {
if fixedVHD {
// We only end up in here with generation 1 vms, because gen 2 doesn't support VHDs
templateString = templateString + `Hyper-V\New-VHD -Path $vhdPath -Fixed -SizeBytes {{ .NewVHDSizeBytes }}` + "\n"
} else {
templateString = templateString + `Hyper-V\New-VHD -Path $vhdPath -SizeBytes {{ .NewVHDSizeBytes }} -BlockSizeBytes {{ .VHDBlockSizeBytes }}` + "\n"
}
}
// Create new VM using the VHD you just made
templateString = templateString + `Hyper-V\New-VM -Name {{ .VMName }} -Path {{ .Path }} -MemoryStartupBytes {{ .MemoryStartupBytes }} -VHDPath $vhdPath -SwitchName {{ .SwitchName }}`
// Add optional tags to the end of the VM creation command
if generation == 2 {
templateString = templateString + ` -Generation {{ .Generation }}`
}