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
Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."
Module
PSScriptAnalyzer
Summary
Missing Description of PSUseDeclaredVarsMoreThanAssignments rules in PSScriptAnalyzerSettings.ps1.
I have tried to exclude one VarName from being marked.
Details
You could define Settings in PSScriptAnalyzerSettings.ps1
i tried to set an rule to exclude one Var but mark all other Var
but that is not working. And i found no description about PSUseDeclaredVarsMoreThanAssignments
This is what i have tried:
Unfortunately, there's no way to suppress the UseDeclaredVarsMoreThanAssignments rule for a single variable. You can suppress the rule for a scriptblock or function with the snippet:
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
<#Rule ID#>'PSUseDeclaredVarsMoreThanAssignments',<#Check ID#>$null,
Justification ='Reason for suppressing'
)]
Although the constructor for SuppressMessageAttribute includes a check ID, it's not used by the UseDeclaredVarsMoreThanAssignments rule in PSSA.
The following issues in the PSSA repository relate to this limitation:
Prerequisites
Get-Foo
cmdlet" instead of "New cmdlet."Module
PSScriptAnalyzer
Summary
Missing Description of PSUseDeclaredVarsMoreThanAssignments rules in
PSScriptAnalyzerSettings.ps1
.I have tried to exclude one VarName from being marked.
Details
You could define
Settings
inPSScriptAnalyzerSettings.ps1
i tried to set an rule to exclude one Var but mark all other Var
but that is not working. And i found no description about PSUseDeclaredVarsMoreThanAssignments
This is what i have tried:
Content Type
How-to
Proposed Title
PSUseDeclaredVarsMoreThanAssignments Rules
Related Articles
No response
The text was updated successfully, but these errors were encountered: