-
Notifications
You must be signed in to change notification settings - Fork 511
Fake warning : $PSNativeCommandUseErrorActionPreference is assigned but never used #4910
New issue
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
Comments
These alerts come from ScriptAnalyzer, so the issue's root would be there, could you reopen the issue there? There's nothing we can do about it here. Thanks! |
Thanks @JustinGrote ! |
Thanks @CyberSinh! I'll reopen this and it will be closed when that version gets integrated into the extension. |
This issue has been labeled as resolved, please verify the provided fix (or other reason). |
@CyberSinh can you confirm this is fixed in the latest pre-release, v2024.3.2-preview, which as PSScriptAnalyzer 1.22.0 (which is supposed to have that fix)? (Seems to be for me!) |
This issue has been labeled as resolved, please verify the provided fix (or other reason). |
@andyleejordan I can confirm the fix works great. Thanks! |
Prerequisites
Summary
If I have
$PSNativeCommandUseErrorActionPreference = $true
in a script, I get the following warning in the Visual Studio Code issue pane:$PSNativeCommandUseErrorActionPreference is assigned but never used.
It is correct to assigned PowerShell preference variables, without explicitly using them in script.
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Add
$PSNativeCommandUseErrorActionPreference = $true
in a script to get the fake warning.Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: