-
Notifications
You must be signed in to change notification settings - Fork 400
-
Hey Guys,
I'm trying to use the script analyzer to check for parse errors in a lot of scripts
I could just use the AST directly and parse the errors, but what I like about the scriptanalyzer is that it also catches invalid syntax around the process block with ParseError: InvalidSyntaxAroundProcessBlock.
The way it is implemented means I cannot just do -Severity ParseError as one has to either include the rule "PSAvoidUsingCmdletAliases" or the severity Warning (which parses the rule) to even discover the error. This could be a bugreport I guess but not looking for that.
I basically have two questions:
- I want to speed up the process because I don't have to parse everything, I'm only interested in parse errors. But since the "PSAvoidUsingCmdletAliases" rule with severity warning has this nice hidden gem included, are there more?
- There seems to be a very big peformance penalty just parsing the file. I mean with Verbose I can see that the rule isn't even processed but analyzing the file of 5100 rules takes nearly a minute. While running all rules only takes about 10 seconds longer. I would have expected a bigger performance gain in analyzing just one rule. Anyone has an idea why this is, parsing a scriptfile with the AST usually goes very fast. Wasn't able to find it in the source code.
Thanks in advance!
Best regards,
Sidney
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment