I wrote some code which is:
var process = new System.Diagnostics.ProcessStartInfo(); ;
process.FileName = @"cmd.exe";
process.Arguments = smth in powershell;
var x = Process.Start(process);
x.WaitForExit();
var result = x.ExitCode;
x.ExisCode returns 0 always despite that I specifically set for this particular example the 15 return value.
How can I get the return value of the function?