Product, version and build: Powershell Studio 2016 - Version: 5.2.124
32 or 64 bit version of product: 64
Operating system: Windows 10
32 or 64 bit OS: 64
PowerShell Version: 5.1 Build 14393
We are using PSScriptAnalyzer on all our scripts and are working to get them error and warning free. We have noticed there are numerous warnings (PSUseApprovedVerbs, PSAvoidUsingEmptyCatchBlock) that get generated from the integrated code. Looks like you ignore those with your builtin integration, but we are getting our scripts scanned during check-in by our Jenkins server. Is there a plan to get these corrected?
PSScriptAnalyzer - Built in functions
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: PSScriptAnalyzer - Built in functions
Yes, we are aware the PSScriptAnalyzer warnings and are reviewing if they warrant any changes. The pre-generated code predates PSScriptAnalyzer and we are careful about making any major changes because of compatibility issues that may occur.
Something to keep in mind: Just because you get a PSScriptAnaylzer warning, it doesn't necessarily mean your script is incorrect. The warnings are often suggestions that are applied generally, but there are exceptions where the use is warranted. You will have to decide on a case by case basis.
Something to keep in mind: Just because you get a PSScriptAnaylzer warning, it doesn't necessarily mean your script is incorrect. The warnings are often suggestions that are applied generally, but there are exceptions where the use is warranted. You will have to decide on a case by case basis.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PSScriptAnalyzer - Built in functions
I know it's not incorrect code, it's just not following best practice. We have some pretty stringent requirements around our scripts and don't want to have to keep manually updating the exported script each time. We can get around most of it, but the calls to the forms are something we haven't been able to address any other way.