From 0c7c143ad1fd45a73de3f7ba71c6e9e142bb7a48 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 18 Jun 2014 16:05:17 +1000 Subject: [PATCH] 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. --- plugins/provisioners/puppet/provisioner/puppet.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index 93f08425e..fe00f3f47 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -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