-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggestions #1
Comments
These are all awesome suggestions! I'll work with Josh on these over the next few months. |
do I know you from somewhere? ;) I think he addressed the first one, which was the breaking one. I am typically writing get and set ps1 files, deploying them as file resources and avoiding this #2 & 3 I have found complex quoting scenarios to be darn maddening to figure out sometimes. ruby escape characters, double quoting single, backslash for regex and backticks between ruby and powershell or ruby cmd and powershell in the default provider are hard |
newb question (both ruby and puppet), but what about delimited strings i.e. As in command => %q{$blah="foo"
write-host '\ hey look'
$write-host $blah} |
yea, you are intertwining ruby with the DSL... they don't meld like that. |
Using a template may help (for now): Henrik is working on adding heredoc support to puppet: http://projects.puppetlabs.com/issues/19886, and should be rolled into the future parser soonish. One the main problems though is that powershell variable assignments, e.g. |
The heredoc support is awesome! great news. template is a good workaround. |
Cool. :) |
@rismoney It sounds like there are two remaining issues, overriding powershell arguments, and heredoc support. The latter is a relatively known quantity and should be possible once the parser supports it. About the former, there is no good way to pass provider specific options without altering the type: http://projects.puppetlabs.com/issues/4113. Since |
Agreed, lets move on. |
@joshcooper can we close this, or should we move it to Jira? |
well this is interesting - great job getting it out here.
A few things I was thinking about:
Number1:
Handle x64 vs x86. We should launch \sysnative\WindowsPowershell\v1.0\powershell.exe if it exists to get 64bit posh. Otherwise launch
\system32\WindowsPowershell\v1.0\powershell.exe. Otherwise launch
powershell.exe based w/o path (assume default)
Number2:
I have not looked at the exec type specifics- does it allow switches? Specifically for powershell, we should be able to launch it with different switches both user controlled and some defaults. Defaults are probably powershell.exe -inputformat none -nologo, -noninteractive, -noprofile, -executionpolicy remotesigned?
Number3:
I am not sure if this is possible- but could we use heredoc to specify a multiline command and generate a file based on it, and run that? I was thinking something like:
or maybe use an erb and pass it to command?
Then- I think I'd want all commands executed as a script block (enclosed in curly braces)
usage:
I welcome you thoughts!
The text was updated successfully, but these errors were encountered: