GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — Enable suppression of PSAvoidAssignmentToAutomaticVariable for specific variable or parameter by fflaten · Pull Request #1896 · PowerShell/PSScriptAnalyzer Conversation
|
|
Intentionally skipped it because suppression was only tested in a general test and not per rule. Can try to add some later today if you want. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| $testCases_ReadOnlyAutomaticVariables = $testCases_AutomaticVariables | Where-Object { $_.IsReadonly } | ||
|
|
||
| It "Variable <VariableName> produces warning of Severity <ExpectedSeverity>" -TestCases $testCases_AutomaticVariables { | ||
| param ($VariableName, $ExpectedSeverity) |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Tip: Param-blocks are no longer needed in Pester v5. Some keep them to make the testcase-contract visible so didn't remove them :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Describe "AvoidAssignmentToAutomaticVariables" { | ||
| Context "ReadOnly Variables" { | ||
| BeforeDiscovery { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added per best practice in Pester v5. Only cosmetic and more explicit in this case.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
In case it didn't show up - ready for review again 🙂 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is great - thank you.
Christoph Bergmeister (@bergmeister)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Cannot Suppress Messages About a Specific Automatic Variable
There was an error while loading. Please reload this page.