I am calling 64-bit Powershell from a 32-bit C# app using the sysnative redirector, which works fine:
Process proc = new Process();
proc.StartInfo.FileName = @"C:\Windows\Sysnative\WindowsPowerShell\v1.0\powershell.exe";
proc.StartInfo.UseShellExecute = false;
proc.Start();
As soon as I add an explicit username/password (even the same one that successfully runs the above), I get a file not found
error starting the process:
Process proc = new Process();
proc.StartInfo.FileName = @"C:\Windows\Sysnative\WindowsPowerShell\v1.0\powershell.exe";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.WorkingDirectory = "somedir";
proc.StartInfo.UserName = "username";
proc.StartInfo.PasswordInClearText = "somepassword";
proc.StartInfo.Domain = "somedomain";
proc.Start();
Is there some limitation on the sysnative
redirector in such a case?