Batch file v PowerShell script

The following code executes the same code via both processes: internal class Program { private static void Main() { const string COMMAND = @”SCHTASKS /QUERY /XML ONE”; Collection<PSObject> psObjects; using (var ps = PowerShell.Create()) { ps.AddScript(COMMAND); psObjects = ps.Invoke(); } var process = new Process { StartInfo = new ProcessStartInfo { UseShellExecute = false, RedirectStandardOutput … Read more