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
Before submitting a bug report:
function FindProgram($name) { $result = $null $path = $ENV:PATH.split([System.IO.Path]::PathSeparator) | ForEach-Object { $test = Join-Path -Path $_ -ChildPath $name if ($IsWindows) { $test = $test + ".exe" } if (Test-Path -Path $test) { $result = "$_/$name" } } return $result }
should be now PSScriptAnalyzer warnings in this code.
The variable 'result' is assigned but never used.PSScriptAnalyzer(PSUseDeclaredVarsMoreThanAssignments)
> $PSVersionTable Name Value ---- ----- PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Microsoft Windows 10.0.19043 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 > (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() } 1.19.1
The text was updated successfully, but these errors were encountered:
Duplicate of #1163
Sorry, something went wrong.
No branches or pull requests
Before submitting a bug report:
Steps to reproduce
Expected behavior
should be now PSScriptAnalyzer warnings in this code.
Actual behavior
The variable 'result' is assigned but never used.PSScriptAnalyzer(PSUseDeclaredVarsMoreThanAssignments)
Environment data
The text was updated successfully, but these errors were encountered: