Powershell task factory execution policy issue#98
Open
professor-k wants to merge 3 commits intomikefourie-zz:releases/4.0from
Open
Powershell task factory execution policy issue#98professor-k wants to merge 3 commits intomikefourie-zz:releases/4.0from
professor-k wants to merge 3 commits intomikefourie-zz:releases/4.0from
Conversation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.