Skip to content
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

Add #Requires -PSEdition and -Assembly #197

Open
wants to merge 3 commits into
base: master
from

Conversation

@theaquamarine
Copy link

@theaquamarine theaquamarine commented Feb 5, 2020

-PSEdition works correctly, but -Assembly is a bit of a cheat. It mostly looks right, but currently it matches the argument as variable.parameter.powershells, with a couple of exceptions:

  • Assembly names can have dots in, #Requires -Assembly System.Management.Automation. This is true of modules too, but currently -Modules AzureRM.Netcore gets tokenised as two variable.parameter.powershells with the dot as a meta.requires.powershell. It looks more or less right as is, but it's an easy enough fix.

  • Assemblies can be specified by file paths, eg #Requires -Assembly path\to\foo.dll. The dots and path separators both get tokenised as meta.requires.powershell, but paths are a bit more complicated to handle. I was hoping there was already a pattern for matching a path, but nothing jumped out at me?

  • Assemblies can be specified using an assembly specifier, eg #Requires -Assembly "System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", which would require allowing quotes, commas, and spaces at least.

Previously they were not treated the way -Modules/-Version/etc were
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

LGTM! Thanks for this contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.