Importing COM PIA when hosting PowerShell -
i have com component , pia installed in gac. in powershell, can do
$a = new-object -com mysvr.progid $x = $a.method([mysvrlib.myenum]::enumvalue)
and understands com enum type.
but when host powershell in app using runspace, provide component instance via runspace.sessionstateproxy.setvariable
, invoke code:
$x = $a.method([mysvrlib.myenum]::enumvalue)
i "unable find type [mysvrlib.myenum]: make sure assembly containing type loaded."
is there way load type definitions of component hosted powershell instance?
in runspaceconfiguration
(option configuring new runspace), there assemblies
property in can add assemblyconfigurationentry object points pia. note: constructor assemblyconfigurationentry expects assembly qualified name microsoft.office.interop.excel, version=14.0.0.0, culture=neutral, publickeytoken=71e9bce111e9429c
.
Comments
Post a Comment