For instances like this, I've usually smashed everything into a one-liner 
using the powershell provider. So...something along the lines of:

command => " \$thing = <result of your query>; Write-Host \"Puppet 
${thingamajig} is a $\thing\""

As can be seen above, it can start looking pretty ugly, especially if the 
commands you are executing are a bit longwinded.  You can get a lot more 
power out of writing custom types/providers and it make for a lot cleaner 
looking manifest, but there aren't a lot of publicly available 
windows-specific ones in the wild right now.  I think most people tend to 
steer towards DSC for that and hope for the best.


On Thursday, August 27, 2015 at 9:06:13 AM UTC-7, Thomas Bartlett wrote:
>
> Nice one, I'll give that a go. You don't happen to know how I can set a 
> variable to equal the result of a powershell command do you? I need to use 
> the hostname of the machine as a parameter for another command. At the 
> minute I'm using hard-coding which is obviously a cardinal sin.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/137c1e96-4285-4a6c-a43a-d7d243fe70e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to