diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index a6928bc12..544536a39 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -552,6 +552,10 @@ module Vagrant error_key(:powershell_invalid_version) end + class PowerShellError < VagrantError + error_key(:powershell_error, "vagrant_ps.errors.powershell_error") + end + class ProviderCantInstall < VagrantError error_key(:provider_cant_install) end diff --git a/plugins/hosts/windows/cap/configured_ip_addresses.rb b/plugins/hosts/windows/cap/configured_ip_addresses.rb index 43820cb5a..cc95775b5 100644 --- a/plugins/hosts/windows/cap/configured_ip_addresses.rb +++ b/plugins/hosts/windows/cap/configured_ip_addresses.rb @@ -15,7 +15,7 @@ module VagrantPlugins script_path = File.expand_path("../../scripts/host_info.ps1", __FILE__) r = Vagrant::Util::PowerShell.execute(script_path) if r.exit_code != 0 - raise Errors::PowershellError, + raise Vagrant::Errors::PowerShellError, script: script_path, stderr: r.stderr end diff --git a/templates/locales/synced_folder_smb.yml b/templates/locales/synced_folder_smb.yml index 65c82de35..3754bc408 100644 --- a/templates/locales/synced_folder_smb.yml +++ b/templates/locales/synced_folder_smb.yml @@ -49,16 +49,6 @@ en: As another option, you can manually specify an IP for the machine to mount from using the `smb_host` option to the synced folder. - powershell_error: |- - An error occurred while executing a PowerShell script. This error - is shown below. Please read the error message and see if this is - a configuration error with your system. If it is not, then please - report a bug. - - Script: %{script} - Error: - - %{stderr} powershell_version: |- PowerShell version 3 or later is required for SMB synced folders to work on Windows. You have version: '%{version}'. Please update