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
There are some new warnings coming up when checking StoreBroker
with newer versions of [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer).
* `PSUseDeclaredVarsMoreThanAssignments` - We had some instances where
a variable was being assigned to but never used. For the API instances,
we now capture to $null in the instances where we don't want the helper
method's results being returned to the user.
* `PSUseShouldProcessForStateChangingFunctions` - Two PackageTool methods
use the verb "Remove" but have no need for providing ShouldProcess support.
Those instances are now suppressed.
All remaining warnings are false positives of `PSUseDeclaredVarsMoreThanAssignments`.
I have opened two different issues against PSScriptAnalyzer to track these false
positives:
* [PSUseDeclaredVarsMoreThanAssignment not correctly handling global vars assigned to within functions](PowerShell/PSScriptAnalyzer#698)
* [PSUseDeclaredVarsMoreThanAssignment not correctly handling array adds](PowerShell/PSScriptAnalyzer#699)
Updated CONTRIBUTING.md to remind users to keep the analyzer module up-to-date.
Additionally, the links in PDP.md were invalid. Those have now been fixed.
Copy file name to clipboardExpand all lines: StoreBroker/PackageTool.ps1
+2-1
Original file line number
Diff line number
Diff line change
@@ -1568,6 +1568,7 @@ function Remove-DeprecatedProperties
1568
1568
#>
1569
1569
[CmdletBinding()]
1570
1570
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns","", Justification="This is intended to be where all deprecated properties are removed. It's an accurate name.")]
1571
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions","", Justification="Does not cause any change to system state. No value gained from ShouldProcess in this specific instance.")]
1571
1572
param(
1572
1573
[Parameter(Mandatory)]
1573
1574
[PSCustomObject] $SubmissionRequestBody
@@ -2125,7 +2126,7 @@ filter Remove-Comment
2125
2126
2126
2127
"example", "test "
2127
2128
#>
2128
-
2129
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions","", Justification="Does not cause any change to system state. No value gained from ShouldProcess in this specific instance.")]
0 commit comments