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

requires -modules hashtable must only occur in a single line, -psedition missing #162

Open
msftrncs opened this issue Mar 9, 2019 · 0 comments

Comments

@msftrncs
Copy link
Contributor

@msftrncs msftrncs commented Mar 9, 2019

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.

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.