-
Notifications
You must be signed in to change notification settings - Fork 510
PowerShell extension uses PSScriptAnalyzer settings file - Cannot update rules #899
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
Actually, the thought that something is wrong, started with noticing that the warning and error count ( in the left lower corner) were and are always 0. |
OK |
Hey Klass, sorry for the delay in response. I'm glad you figured out the issue! You're right, we should indicate that the settings file is missing, I'll reopen this issue so we can track a fix for that. |
Thanks for identifying the bug, as I am not so familiar with the Setup and untill the fix is included, could perhaps be clarified |
@tylerl0706, it looks like there's a bug in the extension where we're not persisting PSSA rule file settings, as above. |
You can use any filename you want but the tyipcal filename is
When using a relative path in a workspace settings file, the path is relative to the workspace root. If you put the setting in your user profile, it should be an absolute path. |
@rjmholt I don't think this feature was designed to persist the set of selected rules between sessions. Another reason I prefer to use a PSSA settings file for the workspace. |
I think it is a minimum viable feature (for the moment) to tell people having to just edit the PSSA setting file themselves but of course, it could be improved. But what is a no go and problem is the fact that when no PSSA settings path is specified, the rules selected via Ctrl+Shift+P are not persisted! I would also like to complain about the fact that not all rules are turned on by default, especially AvoidPossibleIncorrectComparisonWithNull. |
Good points, @bergmeister. There are both older and newer issues that are closely related: #823 (@daviwil) suggests adding support for persisting the existing GUI-based rules selection ( #1443 (@rjmholt) doesn't reference the GUI method, but proposes supporting persistent rule selection via Also, there is another closely related issue that I decided to break out into a separate one: Also related: #2190, where @TylerLeonhardt suggests automatically picking up a |
I had this error when doing:


<ctrl
>+<shift
>+P, PSScript...After Uninstall and reinstall the Powershell extension ( version 1.3.2, the same as it was before), there's another issue:
System Details
$PSVersionTable
:Name Value
PSVersion 5.1.14393.0
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.0
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
I am experiencing a problem with PSScriptAnalyzer: cannot update the rules
Attached Logs
1497967294-c7966750-26b9-4c1a-88bf-382515625aa61497967292400.zip
The text was updated successfully, but these errors were encountered: