How to Pass puppet hashtable to powershell hash parameter

asked 2017-06-05 12:30:05 -0600

senthilvv28 gravatar image

updated 2017-06-05 23:17:05 -0600

DarylW gravatar image

We have the following data defined in default.yaml

  audit_log_filepath: "C:/temp/Audit.log"
  syndication_filepath1: "xsl/200/repcodechooser.xsl"
  syndication_filepath2: "xsl/106/repcodechooser.xsl"

Read the Hash into Puppet Hashtable

$config_hash = hiera("module_ui::config_params")

Execute Powershell with param as hashtable

exec { 'setup-webconfig':
      command   => "& C:\ProgramData\PuppetLabs\code\modules\module_ui\files\ConfigFileProcess.ps1 -HieraDataHashTable $config_hash",
      provider  => powershell,
      logoutput => true,

This will not convert to power shell hash table format . Is there a default support or any module available to convert puppet hastable format to power shell hastable format.

Thanks in advance.

edit retag flag offensive close merge delete