title: How to run PowerShell in x64 or x86 using C#?
body: <p>I'm using this C# code to read my installed programs using PowerShell.</p>
  
  <p>I need it to read both x64 and x86 registry through PowerShell, how am I doing this?</p>
  
  <p>Is there a way to redirect? or maybe run PowerShell in x64 and then x86?</p>
  
  <pre><code>public void conf() {
  process p1 = new Process();
  ProcessStartInfo psi1 = new ProcessStartInfo("powershell", "Get-ItemProperty HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\* | Select-Object DisplayName");
  psi1.RedirectStandardOutput = true;
  psi1.CreateNoWindow = true;
  p1.StartInfo = psi1;
  p1.StartInfo.UseShellExecute = false;
  p1.StartInfo.Verb = "runas";
  p1.Start();
  string output = p1.StandardOutput.ReadToEnd();
  Console.WriteLine(output);
  p1.WaitForExit(400);
  }
  </code></pre>