Stephanevg / PSClassUtils

A set of utilities to work with Powershell Classes
http://powershelldistrict.com/how-to-generate-a-uml-diagram-using-powershell/
91 stars 23 forks source link

Get param types for constructor & methods #127

Open LxLeChat opened 3 years ago

LxLeChat commented 3 years ago

Ok, to get the type of a parameter in a constructor you are doing the following 👍

$Type = $null
# couldn't find another place where the returntype was located. 
# If you know a better place, please update this! I'll pay you beer.
$Type = $Parameter.Extent.Text.Split("$")[0] 

Instead you could do this, wich will give you the type ... \o/ BEER $Type = $Parameter.StaticType.Name

The same applies to methods !