Since HKCU is contextualized to the current user, and the Puppet agent generally runs as SYSTEM, this is almost guaranteed not to do what you want if you can even get it to work. You will likely have to write PowerShell that knows how to change context to another user to accomplish useful things within HKCU.
To solve the errors in your PowerShell example, you will have to escape the slashes, e.g.
However, as mentioned above, this alone probably won't do what
you want / expect, because Puppet is executing in the incorrect
user context.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0c68b9b3-761e-4444-89d5-e3de60aa4ee8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.