Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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> }

.EXAMPLE
Measure-RequiresModules -ScriptBlockAst $ScriptBlockAst
.INPUTS
Expand Down Expand Up @@ -938,4 +938,4 @@ function Measure-HelpNote
}
}

Export-ModuleMember -Function Measure*
Export-ModuleMember -Function Measure*