fix escaping of powershell variable

As this is nested in a powershell variable $command, it must be escaped
otherwise it is evaluated when the variable is created, giving an error that
"The term 'True' is not recognized as the name of a cmdlet, function,
script". This prevented using a puppet.working_directory on Windows.
This commit is contained in:
Brett Porter 2014-06-18 16:05:17 +10:00
parent f0cd8511ed
commit 0c7c143ad1
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ module VagrantPlugins
command = "#{facter}puppet apply #{options}"
if config.working_directory
if windows?
command = "cd #{config.working_directory}; if ($?) \{ #{command} \}"
command = "cd #{config.working_directory}; if (`$?) \{ #{command} \}"
else
command = "cd #{config.working_directory} && #{command}"
end