-
Notifications
You must be signed in to change notification settings - Fork 29
(GH-110) Use PSParser.Tokenize #128
base: master
Are you sure you want to change the base?
Conversation
@ferventcoder is this the sort of thing that you were thinking? |
var tokens = PSParser.Tokenize(contents, out errors); | ||
|
||
var requiredCalls = tokens.Where(p => p.Type != PSTokenType.Comment && | ||
p.Content.to_lower().Contains("createshortcut") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I would call it requiredCalls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ferventcoder I just copied what you had here: #110 (comment) I didn't give it much thought in the first pass 😄
Now that I look at it again, in our case, we are looking for methods that shouldn't be called, so yes, requiredCalls
doesn't make sense. Perhaps prohibitedCalls
. I have no imagination when it comes to naming 😄
<Reference Include="System.Management" /> | ||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll</HintPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad hint path here. Reference the shell of SMA in lib.
Relates to #110