PoshCode Archive  Artifact [6a21de6112]

Artifact 6a21de6112a4214083d68c612685c5bd51e0d8b616ec2fcfd5fedea31668411f:

  • File Get-StaticMethodDefin.ps1 — part of check-in [0eb5054a65] at 2018-06-10 14:27:35 on branch trunk — Helper function to list the definitions of static methods (user: Steven Murawski size: 881)

# 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"}
		}
	}
}