private void ExecuteScript()

in eng/update-dependencies/ScriptRunnerUpdater.cs [43:64]


        private void ExecuteScript()
        {
            Trace.TraceInformation($"Executing '{_scriptPath}'");

            // Support both execution within Windows 10, Nano Server and Linux environments.
            Process process;
            try
            {
                process = Process.Start("pwsh", _scriptPath);
                process.WaitForExit();
            }
            catch (Win32Exception)
            {
                process = Process.Start("powershell", _scriptPath);
                process.WaitForExit();
            }

            if (process.ExitCode != 0)
            {
                throw new InvalidOperationException($"Unable to successfully execute '{_scriptPath}'");
            }
        }