PowerTip: Find Class Constructors in PowerShell 5

The Scripting Guys

Dr Scripto

Summary: Learn how to easily find class constructors.

Hey, Scripting Guy! Question How can I use Windows PowerShell 5.0 to find the constructor overloads for a new class I want to create?

Hey, Scripting Guy! Answer Place the class in square brackets, and call the static New method with no parentheses, for example:

[datetime]::new

The Scripting Guys
Dr Scripto

Follow Dr Scripto   

No Comments.