Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powershell task factory execution policy issue #98

Open
wants to merge 3 commits into
base: releases/4.0
Choose a base branch
from

Conversation

professor-k
Copy link

I stumbled upon the fact that powershell task factory has issues with execution policy when run on Windows 10. Basically, it won't run even if machine has them completely turned off. Some people encountered similar issue on similar code: michaelburns/LaunchPad#5
There is reference to the blog post in that issue, sadly it's dead already. I'm not powershell expert, but just mimicking their solution worked for me. While at it I also looked up how to intercept outputs from powershell pipeline and added respective code.

@professor-k
Copy link
Author

p.s. It appeared that it was impossible to intercept "Write-Host" calls the way I did it first time. Bit more of stackoverflowing brought me to what is currently recommended way of in-app hosting of a script (https://docs.microsoft.com/en-us/powershell/scripting/developer/hosting/windows-powershell-host-quickstart?view=powershell-7.1). I updated the task template accordingly. Works like a charm now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant