Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

(GH-110) Use PSParser.Tokenize #128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gep13
Copy link
Member

@gep13 gep13 commented Feb 17, 2016

Relates to #110

@gep13
Copy link
Member Author

gep13 commented Feb 17, 2016

@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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 👍

Copy link
Member

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.

Copy link
Member Author

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>
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants