dotnet-installer/src/dotnet/ProcessStartInfoExtensions.cs

27 lines
571 B
C#
Raw Normal View History

2017-02-14 11:38:01 -08:00
using System;
using System.Diagnostics;
namespace Microsoft.DotNet.Cli
{
internal static class ProcessStartInfoExtensions
{
public static int Execute(this ProcessStartInfo startInfo)
{
2017-02-14 11:38:01 -08:00
if (startInfo == null)
{
throw new ArgumentNullException(nameof(startInfo));
}
var process = new Process
{
StartInfo = startInfo
};
process.Start();
process.WaitForExit();
return process.ExitCode;
}
}
}