< Back

Get-MethodParameter

Mon Jan 13, 2020 8:24 pm

NAME Get-MethodParameter



SYNOPSIS

Gets parameters of methods.





SYNTAX

Get-MethodParameter -Method <MethodInfo> [[-Name] <String>] [<CommonParameters>]





DESCRIPTION

Get-MethodParameter gets the parameters of a method supplied as a MethodInfo object.





PARAMETERS

-Method <MethodInfo>

The method to get parameters from.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Name <String>

The name of the parameter to retrieve. Accepts wildcards.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Reflection.MethodInfo





You can pipe MethodInfo objects to Get-MethodParameter.





OUTPUTS

System.Reflection.ParameterInfo

Get-Method returns a Parameter object for each parameter retrieved.





NOTES





This is a companion to the Get-Method command in this module.



Author: Chris Carter

Version: 1.0



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>[String] | Get-Method -Name CreateTrimmedString -NonPublic -Instance | Get-MethodParameter



This command will get the parameters of the private instance method CreateTrimmedString of the String class.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>[String] | Get-Method -Name CreateTrimmedString -NonPublic -Instance | Get-MethodParameter -Name start



This command will get the parameter start of the private instance method CreateTrimmedString of the String class.











RELATED LINKS