Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd #Requires -PSEdition and -Assembly #197
Conversation
Previously they were not treated the way -Modules/-Version/etc were
|
LGTM! Thanks for this contribution |
-PSEditionworks correctly, but-Assemblyis a bit of a cheat. It mostly looks right, but currently it matches the argument asvariable.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.Netcoregets tokenised as twovariable.parameter.powershells with the dot as ameta.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 asmeta.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.