Ask Your Question

How do you get a manifest to stay with a PowerShell script until it is complete?

asked 2016-11-15 20:26:16 -0500

Conventional gravatar image

I have complex PowerShell scripts that I would like Puppet manifests to govern. I use a PowerShell plugin. I can have Puppet manifests transfer a PowerShell script and run it. The relevant messages of a Puppet Agent running and associated logs on the Puppet Agent server and Puppet master server can show a success well before the PowerShell script has finished. Is there a way or trick to getting a Puppet manifest to not show such quick "successes" and wait for the entire PowerShell script to finish? The solution may be more of a PowerShell fix than a Puppet fix.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-11-16 03:34:42 -0500

helge gravatar image

We will need to see the script.

But usually this behavior only occurs when a thread is started from within your script. Bear in mind that some commands, commandlets do that intentionally (eg. msiexec.exe and all related, this is the reason the MSI provider prefixes start /w "puppet.-install" ... ).

If this this is the case, you could try Start-Process, though there are numerous other ways witch might fit your need better:

Start-Process <path> -Wait -NoNewWindow

edit flag offensive delete link more

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: 2016-11-15 20:26:16 -0500

Seen: 19 times

Last updated: Nov 16 '16