diff --git a/builder/hyperv/common/step_create_vm.go b/builder/hyperv/common/step_create_vm.go index f745514e1..d88de5558 100644 --- a/builder/hyperv/common/step_create_vm.go +++ b/builder/hyperv/common/step_create_vm.go @@ -47,8 +47,8 @@ func (s *StepCreateVM) Run(state multistep.StateBag) multistep.StepAction { } else { log.Println("No existing virtual harddrive, not attaching.") } - - vhdPath := state.Get("packerVhdTempDir").(string) + + vhdPath := state.Get("packerVhdTempDir").(string) // convert the MB to bytes ramSize := int64(s.RamSize * 1024 * 1024) diskSize := int64(s.DiskSize * 1024 * 1024) diff --git a/common/powershell/hyperv/hyperv.go b/common/powershell/hyperv/hyperv.go index 4d6e78b65..0c649c450 100644 --- a/common/powershell/hyperv/hyperv.go +++ b/common/powershell/hyperv/hyperv.go @@ -218,7 +218,7 @@ if ($harddrivePath){ ` var ps powershell.PowerShellCmd err := ps.Run(script, vmName, path, harddrivePath, vhdRoot, strconv.FormatInt(ram, 10), strconv.FormatInt(diskSize, 10), switchName) - + if err != nil { return err }