| external help file | PSScriptTools-help.xml |
|---|---|
| Module Name | PSScriptTools |
| online version | http://bit.ly/31XfFER |
| schema | 2.0.0 |
Retrieve command parameter information.
Get-ParameterInfo [-Command] <String> [-Parameter <String>]
[<CommonParameters>]Using Get-Command, this function will return information about parameters for any loaded cmdlet or function. The common parameters like Verbose and ErrorAction are omitted. Get-ParameterInfo returns a custom object with the most useful information an administrator might need to know. See examples.
PS C:\> Get-ParameterInfo Export-Clixml
ParameterSet: __AllParameterSets
Name Aliases Mandatory Position Type
---- ------- --------- -------- ----
Depth False Named System.Int32
InputObject True Named System.Management.Automation.PSObject
Force False Named System.Management.Automation.SwitchParamet…
NoClobber NoOverwrite False Named System.Management.Automation.SwitchParamet…
Encoding False Named System.Text.Encoding
ParameterSet: ByLiteralPath
Name Aliases Mandatory Position Type
---- ------- --------- -------- ----
LiteralPath PSPath,LP True Named System.String
ParameterSet: ByPath
Name Aliases Mandatory Position Type
---- ------- --------- -------- ----
Path True 0 System.StringReturn parameter information for Export-Clixml using the default table view.
PS C:\> Get-ParameterInfo mkdir | Select-Object Name,Type,Position,parameterset
Name Type Position ParameterSet
---- ---- -------- ------------
Path System.String[] 0 pathSet
Path System.String[] 0 nameSet
Name System.String Named nameSet
Value System.Object Named __AllParameterSets
Force System.Management.Automation.Switch... Named __AllParameterSets
Credential System.Management.Automation.PSCred... Named __AllParameterSets
UseTransaction System.Management.Automation.Switch... Named __AllParameterSetsGet selected parameter information for the mkdir command.
PS C:\> Get-ParameterInfo Test-WSMan | Format-List
ParameterSet: __AllParameterSets
Name : ComputerName
Aliases : cn
Mandatory : False
IsDynamic : False
Position : 0
Type : System.String
ValueFromPipeline : True
ValueFromPipelineByPropertyName : False
Name : Authentication
Aliases : auth,am
Mandatory : False
IsDynamic : False
Position : Named
Type : Microsoft.WSMan.Management.AuthenticationMecha
nism
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Name : Credential
Aliases : cred,c
Mandatory : False
IsDynamic : False
Position : Named
Type : System.Management.Automation.PSCredential
ValueFromPipeline : False
ValueFromPipelineByPropertyName : True
Name : CertificateThumbprint
Aliases :
Mandatory : False
IsDynamic : False
Position : Named
Type : System.String
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
ParameterSet: ComputerName
Name : Port
Aliases :
Mandatory : False
IsDynamic : False
Position : Named
Type : System.Int32
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Name : UseSSL
Aliases :
Mandatory : False
IsDynamic : False
Position : Named
Type : System.Management.Automation.SwitchParameter
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Name : ApplicationName
Aliases :
Mandatory : False
IsDynamic : False
Position : Named
Type : System.String
ValueFromPipeline : False
ValueFromPipelineByPropertyName : False
Get all parameters from Test-WSMan and display details as a list.
PS C:\> Get-ParameterInfo -Command Get-Counter -Parameter computername
ParameterSet: __AllParameterSets
Name : computername
Aliases : Cn
Mandatory : False
IsDynamic : False
Position : Named
Type : System.String[]
ValueFromPipeline : False
ValueFromPipelineByPropertyName : FalseGet details on the Computername parameter of the Get-Counter cmdlet.
The name of a cmdlet or function. The parameter has an alias of Name.
Type: String
Parameter Sets: (All)
Aliases: name
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseType: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/