Running 32bit powershell on a 64bit server from c# -


i wondering if there way stipulate version of powershell initialised (32bit\64bit) on 64bit windows 2008 server using c# , the system.automation namespace?

the reason have created ps1 script uses com object work in 32bit powershell environment.

i not aware of way specify 32bit\64bit during runspace creation may wrong. thoughts or suggestions?

thanks

changing application's configuration "any cpu"/"x64" "x86" simplest way make sure powershell script runs in 32-bit. can check script these contents:

if ([system.intptr]::size -eq 8) {'64-bit'} else {'32-bit'} 

configuring runspace 32-bit running in 64-bit application may possible, may more trouble it's worth.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -