Summary of the new feature/enhancement
As a user, when I inspect the overloads of a given .NET method, I want to know which parameters are optional, so I only pass arguments to them if actually needed.
Accessing a method without invoking it (via (...)) conveniently shows all its overloads (signatures), but currently doesn't indicate which parameters are optional:
Add-Type -NameSpace demo -Name Foo -MemberDefinition 'public static void Bar(string param, int optParam = -1) { }'
# Show the method signature.
[demo.Foo]::Bar
Current output - NO indication that optParam is optional):
OverloadDefinitions
-------------------
static void Bar(string param, int optParam)
Desired output - clear indication that optParam is optional, ideally also with its default value, if technically feasible:
OverloadDefinitions
-------------------
static void Bar(string param, int optParam = -1)
Note: The same representation should be used for Get-Member output, as originally proposed in #7373.
I suspect that the implementation is shared anyway.
Summary of the new feature/enhancement
As a user, when I inspect the overloads of a given .NET method, I want to know which parameters are optional, so I only pass arguments to them if actually needed.
Accessing a method without invoking it (via
(...)) conveniently shows all its overloads (signatures), but currently doesn't indicate which parameters are optional:Current output - NO indication that
optParamis optional):Desired output - clear indication that
optParamis optional, ideally also with its default value, if technically feasible:Note: The same representation should be used for
Get-Memberoutput, as originally proposed in #7373.I suspect that the implementation is shared anyway.