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

Fix typo in .Description for Measure-RequiresModules #888

Merged
merged 2 commits into from
Feb 15, 2018

Conversation

TimCurwick
Copy link
Contributor

PR Summary

Fix typo - Change "-RunAsAdministrator" to "-Modules" in .Description for Measure-RequiresModules.

Error is presumed to have been copy and paste from Measure-RequiresRunAsAdministrator, where it was appropriate.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets. Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • [NA] User facing documentation needed
  • Change is not breaking
  • [NA] Make sure you've added a new test if existing tests do not effectively test the code changed
  • [NA] This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@@ -126,7 +126,7 @@ function Measure-RequiresRunAsAdministrator
.DESCRIPTION
The #Requires statement prevents a script from running unless the Windows PowerShell version, modules, snap-ins, and module and snap-in version prerequisites are met.
From Windows PowerShell 3.0, the #Requires statement let script developers specify Windows PowerShell modules that the script requires.
To fix a violation of this rule, please consider to use #Requires -RunAsAdministrator instead of using Import-Module.
To fix a violation of this rule, please consider to use #Requires -Modules instead of using Import-Module.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution. The fix of this copy-paste mistake makes sense.
However, by looking at the documentation here, I think it would be better to state the full synax:
#Requires -Modules { <Module-Name> | <Hashtable> }

@JamesWTruher JamesWTruher merged commit c54c8fe into PowerShell:development Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants