We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-SomeKeyValuePairs | Where-Object { some validation script } Foreach-Object -Begin { $failedValidation = [System.Collections.ArrayList]@() } -Process { $failedValidation.Add($_.Name) } -End { if (@($failedValidation).Count -gt 0) { throw "The following required parameters were empty: $($failedValidation -join ', ')." } }
(Note: There are much better ways to write this, one of which I am now using; this code was just my first shot at the problem.)
No output from the analyzer.
I receive a warning indicating "The variable 'failedValidation' is assigned but never used."
> $PSVersionTable Name Value ---- ----- PSVersion 5.1.15063.1563 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.15063.1563 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 > (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() } 1.17.1
The text was updated successfully, but these errors were encountered:
Duplicate of #1031
Sorry, something went wrong.
Issue still present in 1.18.1 ;-(
Duplicate of #1163
No branches or pull requests
Steps to reproduce
(Note: There are much better ways to write this, one of which I am now using; this code was just my first shot at the problem.)
Expected behavior
No output from the analyzer.
Actual behavior
I receive a warning indicating "The variable 'failedValidation' is assigned but never used."
Environment data
The text was updated successfully, but these errors were encountered: