Saturday, 10 June 2017

Static classes in Powershell

Static in PowerShell is calling a method without creating instance of the object.
In Powershell it not always mandatory to create new function, there are many existing .Net build function can be used.

Eg. [Math] class

PS C:\> [math]::Sqrt(4)

To see all the static method associated with the class

PS C:\> [math] | gm -Static

Happy Learning

No comments:

Post a Comment


Born as Mathematician, Found love in Scripting and want to have an affair with C#

Total Pageviews