September 9th, 2015

PowerTip: Find Class Constructors in PowerShell 5

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.