exec not working in manifest with powershell commmand

9 views
Skip to first unread message

David Yeo

unread,
Aug 9, 2016, 8:56:44 AM8/9/16
to Puppet Users
All,

I have a requirement for automating the setup of IIS through puppet enterprise, I have a manifest which is not fully executing a powershell command utilising 'exec' (see below)

exec { 'SetvirtualDirectoryDefaultsuserName':
  command => '$(Set-ItemProperty -Path "IIS:\Sites\MainWebSite" -Name virtualDirectoryDefaults.userName -Value domain\username)',
  provider => powershell,
 }

the powershell command works perfectly if run direct from a powershell console

Where am I going wrong?

Thanks

Rob Nelson

unread,
Aug 9, 2016, 9:08:43 AM8/9/16
to puppet...@googlegroups.com
Can you share the logs from your puppet run showing the error(s) received?

Also, you may want to look at the module https://forge.puppet.com/puppet/iis, which may either handle this already, or be a good example of code you can build on if the feature is not present.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3923f695-665e-47ff-8029-b591ffb6dbc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages