Pass an enum value to a method of a ComObject in Powershell
<p>I want to pass an Enum Parameter to a method of a ComObject in Powershell. The problem is, that I do not know how to create this parameter. The Signature of the method is My.ComObject.Method(EnumType, string, string).</p>

<pre><code>$o = New-Object -ComObject "My.ComObject"
$o.method([My.EnumType]::EnumValue, "s", "s")
</code></pre>

<p>The code above always throws a TypeNotFoundException. I also tried to specifiy the enum as a string, but this throws another exception saying, that it cannot convert a string to an object.</p>

<p>What do I need to do, to create an enum value of an enum type that is located in the same COM assembly as the ComObject I created.</p>

<p>Thanks</p>

<p>Pascal</p>