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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -