# encoding: ascii
# api: powershell
# title: Get-StaticMethodDefin
# description: Helper function to list the definitions of static methods
# version: 0.1
# type: function
# author: Steven Murawski
# license: CC0
# function: Get-StaticMethodDefinition
# x-poshcode-id: 968
# x-archived: 2011-05-04T04:56:20
# x-published: 2011-03-20T05:01:00
#
#
#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"}
}
}
}