Ask Your Question

Powershell and Transcript

asked 2014-03-25 22:10:34 -0500

dancewind gravatar image

We would like to use puppet exec to execute a powershell script as bellow.

exec {"powershell -executionpolicy remotesigned -file ${app_dir}/Deploy/0.Prod.Deploy.ps1" :
            path => 'C:/Windows/System32/WindowsPowerShell/v1.0',
            cwd => "${app_dir}/Deploy",
            refreshonly => true,
            require => File["${app_dir}/WebSite" ],

Before, we use the script below to log the output :

.\1.SIT.Copy.ps1|Out-File .\DeployOutput.txt

When doing "puppet agent --test", this will successfully log the output to DeployOutput.txt.

However, this does not support the error message during executing the script.

Instead, we tried using Transcript to log the executing process:

 Start-Transcript -path ".\DeployOutput.txt" -Force
 .\1 ...
edit retag flag offensive close merge delete


Have you tried the powershell provider instead?

nanliu gravatar imagenanliu ( 2014-03-26 01:30:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-21 21:49:02 -0500

dancewind gravatar image

Thanks for your suggestion. I tried to use the module, but failed with lots of issues. Finally, we rewrite the puppet script to cover all the powershell execution commands.

edit flag offensive delete link more


What specifically did you fail on with the powershell provider module? It now falls under the Puppet Supported Modules. :)

rob gravatar imagerob ( 2014-10-03 23:01:29 -0500 )edit

If this if what you believe to be the answer, I can mark it as the answer for you.

rob gravatar imagerob ( 2014-10-03 23:01:49 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-03-25 22:10:34 -0500

Seen: 219 times

Last updated: Mar 25 '14