-
Notifications
You must be signed in to change notification settings - Fork 49
PSScriptAnalyzer writes unnecessary warning when using custom rules #176
Comments
I was thinking about this yesterday. I think it is actually calling I plan to do some investigation on this over the weekend. Worst case scenario I might be able to suppress this call to |
It must be something when PSSA is called with the CustomRulePath parameter. I thought I could follow the C# code and see what it does, but didn't have time to look into it. Might not be related, but I saw they had the same issue over at PSake and apparently it showed this warning when they called Write-Host in one scenario. So maybe this warning is printed when some command tries to do something interactive but the code is not running interactive (in a console). |
You may be right - the actual command that is being run may just be a red-herring. I'll see if I can track it down this weekend. |
It looks like this was an issue in versions of PSSA prior to 1.2.0. It looks like they fixed this in v1.2.0 (see CHANGELOG.md). I think the solution here is to check for the version of PSSA installed and either recommend the user upgrades (if in user mode) or force an update if in AppVeyor. |
Ignore previous comment. This problem was only identified but was not fixed. A solution has been identified. See https://github.com/PowerShell/PSScriptAnalyzer/blob/development/Engine/ScriptAnalyzer.cs#L1120 What I'll do is set the registry key HKLM:\Software\Microsoft\PowerShell\DisablePromptToUpdateHelp to 1 when running in AppVeyor. This should suppress the warning. |
When running PSSA Custom rules it outputs a warning. This is probably PSScriptAnalyzer that is doing something (doing a
Write-Host
or similar? Just guessing).If it is PSScriptAnalyzer, is it worth opening up a issue in that repo?
More information from @PlagueHO in PR #162.
Opening this issue to track this.
The text was updated successfully, but these errors were encountered: