diff --git a/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 b/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 index a380a38f3..fd11bdba1 100644 --- a/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 +++ b/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 @@ -1,3 +1,6 @@ +# Always stop when errors are encountered unless instructed not to +$ErrorActionPreference = "Stop" + # Vagrant VM creation functions function New-VagrantVM { @@ -123,7 +126,7 @@ function New-VagrantVMVMCX { $Path = $Drive.Path Hyper-V\Remove-VMHardDiskDrive $Drive Hyper-V\New-VHD -Path $DestinationPath -ParentPath $SourcePath - Hyper-V\AddVMHardDiskDrive -VM $VM -Path $DestinationPath + Hyper-V\Add-VMHardDiskDrive -VM $VM -Path $DestinationPath break } }