You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PS>$ss='class foo { >> [string]ToString() { >> return (gci).ToString()>> } >> }'
PS>Invoke-ScriptAnalyzer-ScriptDefinition $ss
RuleName Severity ScriptName Line Message
-------------------------------------
PSAvoidUsingCmdletAliases Warning 3'gci' is an alias of 'Get-ChildItem'. Alias can introduce
possible problems and make scripts hard to maintain. Please
consider changing alias to its full content.
James Truher (@JamesWTruher) when i call psscriptanalyzer with Invoke-ScriptAnalyzer -Path .\scripts\test.ps1 -ReportSummary it is showing 0 warnings but when i call psscriptanalyzer with Invoke-ScriptAnalyzer -Path . -Recurse -ReportSummary it's showing the warning.
Is this a known bug?
Edit: it's always showing the warning i was not requiring the PSScriptAnalyzerSettings.psd1 file when i called ScriptAnalyzer against the file.
Activity
[-]How to suppress a warning for a method?[/-][+]How to suppress a warning in a method?[/+]JamesWTruher commentedon Sep 15, 2020
it can be done with the appropriate attribute as the following shows:
without the attribute
floh96 commentedon Sep 15, 2020
It's not working in the following example:
I have set MaximumLineLength = 80 in psscriptanalyzersettings.psd1.
Still displays the warning:
floh96 commentedon Sep 15, 2020
James Truher (@JamesWTruher) when i call psscriptanalyzer with
Invoke-ScriptAnalyzer -Path .\scripts\test.ps1 -ReportSummaryit is showing 0 warnings but when i call psscriptanalyzer withInvoke-ScriptAnalyzer -Path . -Recurse -ReportSummaryit's showing the warning.Is this a known bug?
Edit: it's always showing the warning i was not requiring the PSScriptAnalyzerSettings.psd1 file when i called ScriptAnalyzer against the file.
rjmholt commentedon Sep 15, 2020
Code for context:
PSScriptAnalyzer/Engine/Helper.cs
Lines 1265 to 1297 in f71cad7
floh96 commentedon Sep 22, 2020
James Truher (@JamesWTruher) Rob Holt (@rjmholt) Sydney Smith (@SydneyhSmith) is someone looking into this? (sorry for asking again since this issue has the resolution anwsered label I was afraid that it will get overlooked.)
Or should I open a new issue?