We need a Get-Parameter cmdlet
Votes from Connect: 41
Original Date Submitted: 9/8/2011 8:47:16 PM
Description:
Contact Information
Handle: HalR
Site Name: PowerShell
Feedback ID: 687640
Frequency: Always Happens
Regression: Yes, this happens in all previous versions
Problem Description:
Something similar to the Get-Parameter function published on PoshCode (see http://poshcode.org/?lang=&q=get-parameter for latest version) needs to be included in PowerShell. The purpose of Get-Parameter is to parse the output of a cmdlet or function's CommandInfo returned from Get-Command, and turn it into a more useful format by which the end user can discover more about:
- what paraemtersets exist?
- what triggers a parameterset? (i.e. which are mandatory)
- what pipeline input does a cmdlet/function accept?
And more. Some of these are questions that you can discern from the help file only after reading pages and pages of data (Get-Help -Full) and basically doing much more work in your head than is necessary. Some of these questions cannot be adequately answered in the help at all and must be discovered by experimentation if the help author omitted input type data.
The answers are all in the paraameterset data. IMHO the Get-Parameter function is more useful than Get-Help because while you will refer to the help the first few times when using a new cmdlet, once you have the basics down, Get-Parameter is a more quickly digested tool and something that you will end up using on a daily basis.
More details can be found on this blog post: http://halr9000.com/article/507
P.S. I like 'gpm' as a built-in alias.
Product Studio item created by Connect Synchronizer due to creation of feedback ID 687640 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=687640).
Repro Steps:
Expected Results:
Love this:
PS > gpm Get-EventLog
ParameterSet: LogName
Name Type IsMandatory Pipeline
LogName String True False
ComputerName String[] False False
Newest Int32 False False
InstanceId Int64[] False False
Index Int32[] False False
EntryType String[] False False
Source String[] False False
Message String False False
AsBaseObject SwitchParameter False False
ParameterSet: List
Name Type IsMandatory Pipeline
ComputerName String[] False False
List SwitchParameter False False
AsString SwitchParameter False False
Internal BugId: 3010
