In order to call a static / shared .NET method from PowerShell, use the following format.

Format:

1[type]::StaticMethodName

Example:

1[DateTime]::Now

Note: In this specific example, the PowerShell alias Get-Date could be used instead of [DateTime]::Now - this is just an example!

Please leave below any comments, feedback or suggestions, or alternatively contact me on a social network.

comments powered by Disqus