I am dynamically generating .net objects of a certain type like this $MyType=([System.Type]::GetType("System.String")
This works fine for standard .net objects.
I now created a custom class like this
class InstanceName
{
[String] hidden $Val
InstanceName([String]$CVal)
{
$this.Val=$CVal
}
}
Here, this method does not work as powershell cannot find the type.
$MyType=([System.Type]::GetType("InstanceName")
Any idea how I can get a System.Type of a custom PS class?
Thx!