Get-StaticMethodDefin (modification of post by Steven Murawski view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/968"></script>download | new post
Helper function to list the definitions of static methods
- #Steven Murawski
- #http://blog.usepowershell.com
- #03/20/2009
- #Examples:
- # get-staticmethoddefinition max math
- # [math] | get-staticmethoddefinition max
- function Get-StaticMethodDefinition()
- {
- param ([string[]]$Method, [Type]$Type=$null)
- BEGIN
- {
- if ($Type -ne $null)
- {
- $Type | Get-StaticMethodDefinition $Method
- }
- }
- PROCESS
- {
- if ($_ -ne $null)
- {
- $_ | Get-Member -Name $Method -Static -MemberType Method | ForEach-Object {$_.Definition -replace '\), ', "), `n"}
- }
- }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository