EditorSyntax
EditorSyntax copied to clipboard
requires -modules hashtable must only occur in a single line, -psedition missing
The hashtable option on a #requires statement must all be on one line (as all #requires statements must be), due to the fundamentals of the single line comment that it rides on, and backticks cannot be used to extend the line, nor can the quoted strings. A special syntax could be applied, but both unquoted and quoted property names are permitted, so it might not be foolproof to only syntax the known property names.
Reference TheBigTestFile.ps1:
#Requires -Modules PSWorkflow @{
ModuleName="PSScheduledJob"
ModuleVersion="1.0.0.0"
}
This is the correct syntax:
#Requires -Modules PSWorkflow, @{ModuleName="PSScheduledJob"; ModuleVersion="1.0.0.0"}
Also, the -psedition parameter is not scoped. At this time it has only known arguments, 'core' and 'desktop'.
And it also appears that these parameter names work differently and allow for shortcutting, using no more characters than required to uniquely distinguish the parameter name.