I've looked through several Questions and didn't find anything that was similar enough to apply to my situation (from what I could tell).
I have a x64 Application (I am not able to change architecture as per design requirements) and it needs to Invoke a PowerShell Script under the x86 Architecture.
var runspaceConfiguration = RunspaceConfiguration.Create();
var runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration);
runspace.Open();
var pipeline = runspace.CreatePipeline();
var myCommand = new Command(@"MY-COMMAND");
myCommand.Parameters.Add("Path", @"C:\");
pipeline.Commands.Add(myCommand);
return pipeline.Invoke();
If anyone can give me an idea how I can start a x86-PowerShell session from C# I would greatly appreciate it.
Edit: I'll update this with corrected code once I've ironed out the details.