Issue #20528 has been updated by Andrew Parker.
Subject changed from puppet.bat in windows install mangles one liners to puppet
in windows install mangles one liners (using Start Command Prompt with Puppet)
Status changed from Unreviewed to Ready for Documentation
The problem is that the `>` character is being interpreted by `cmd.exe` since
it is inside single quotes ('). The fix for this is to change the command to
use double quotes (").
<pre>
puppet apply -e "notify { foo: message => 'hello world!' }"
</pre>
There is a lot of character quoting subtlety that needs to be taken into
account. It seems as though double quotes will resolve these problems, but
you'll then need to escape any double quotes. See
<http://www.robvanderwoude.com/escapechars.php> for some info on escaping on
windows.
This issue and the resolution should be documented in the [Troubleshooting
Guide](http://docs.puppetlabs.com/windows/troubleshooting.html).
----------------------------------------
Bug #20528: puppet in windows install mangles one liners (using Start Command
Prompt with Puppet)
https://projects.puppetlabs.com/issues/20528#change-90408
* Author: Andrew Parker
* Status: Ready for Documentation
* Priority: Normal
* Assignee: Josh Cooper
* Category:
* Target version:
* Affected Puppet version:
* Keywords:
* Branch:
----------------------------------------
The command:
<pre>
C:\Program Files (x86)\Puppet Labs\Puppet\bin>puppet apply -e 'notify { foo:
message => "hello world!" }'
</pre>
Produces:
<pre>
Error: Could not parse for environment production: Syntax error at '=';
expected '}' at line 1 on node win-p4cvm028u5j.localdomain
Error: Could not parse for environment production: Syntax error at '=';
expected '}' at line 1 on node win-p4cvm028u5j.localdomain
</pre>
If you take the same snippet and place it in a `.pp` file, it works.
<pre>
C:\Program Files (x86)\Puppet Labs\Puppet\bin>type t.pp
notify { foo: message => "hello world!" }
C:\Program Files (x86)\Puppet Labs\Puppet\bin>puppet apply t.pp
Notice: hello world!
Notice: /Stage[main]//Notify[foo]/message: defined 'message' as 'hello world!'
Notice: Finished catalog run in 0.12 seconds
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.