I'm reading information on various objects from an XML file and need to instantiate and set values on these objects from PowerShell.
This is a sample where UInt32.Parse(string) should be retrieved using Reflection. The problem is the $mi variable is null:
$o = new-object -typename "System.UInt32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
$mi = $o.GetType().GetMethod("Parse", [type[]] @([string].GetType()) )
The corresponding C# code works:
UInt32 o = 0;
var mi = o.GetType().GetMethod("Parse", new [] {typeof(string)});
Any ideas?