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)
2

To see all the static method associated with the class


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

Happy Learning

No comments:

Post a Comment

..Love

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

Total Pageviews