Just a tip #10 – Get overload definitions of a method in PowerShell

To refer the overload definitions/syntax of a method of an object using the OverloadDefinitions property of a method with simple dot notation…

<object>.<method>.OverloadDefinitions

Example:

$Text = "PowerShell"

# To see all the methods of an object
$Text | Get-Member -MemberType *Method

$Text.LastIndexOf.OverloadDefinitions

Screenshot from 2020-01-01 20-40-13

Thank you.

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.