diff --git a/api_list.include.md b/api_list.include.md index cb9578a6..7ba88a03 100644 --- a/api_list.include.md +++ b/api_list.include.md @@ -804,17 +804,17 @@ * `Task WaitForExitStatusAsync(CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.waitforexitstatusasync?view=net-11.0) * Note: On Unix the terminating signal is derived from the exit code, which is 128 plus the signal number, instead of from the raw wait status. A process that exits normally with, for example, code 143 is therefore reported as terminated by SIGTERM. * `ProcessExitStatus Run(ProcessStartInfo, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-diagnostics-processstartinfo-system-nullable((system-timespan)))) - * `ProcessExitStatus Run(string, IList?, bool, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-string-system-collections-generic-ilist((system-string))-system-boolean-system-nullable((system-timespan)))) + * `ProcessExitStatus Run(string, IEnumerable?, bool, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-string-system-collections-generic-ienumerable((system-string))-system-boolean-system-nullable((system-timespan)))) * Note: When silent is true, standard output and error are suppressed by redirecting and discarding them (rather than binding to the null device as on net11); standard input remains connected. * `ProcessTextOutput RunAndCaptureText(ProcessStartInfo, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-diagnostics-processstartinfo-system-nullable((system-timespan)))) - * `ProcessTextOutput RunAndCaptureText(string, IList?, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-string-system-collections-generic-ilist((system-string))-system-nullable((system-timespan)))) + * `ProcessTextOutput RunAndCaptureText(string, IEnumerable?, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-string-system-collections-generic-ienumerable((system-string))-system-nullable((system-timespan)))) * `Task RunAndCaptureTextAsync(ProcessStartInfo, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-diagnostics-processstartinfo-system-threading-cancellationtoken)) - * `Task RunAndCaptureTextAsync(string, IList?, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-string-system-collections-generic-ilist((system-string))-system-threading-cancellationtoken)) + * `Task RunAndCaptureTextAsync(string, IEnumerable?, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-string-system-collections-generic-ienumerable((system-string))-system-threading-cancellationtoken)) * `Task RunAsync(ProcessStartInfo, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-diagnostics-processstartinfo-system-threading-cancellationtoken)) - * `Task RunAsync(string, IList?, bool, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-string-system-collections-generic-ilist((system-string))-system-boolean-system-threading-cancellationtoken)) + * `Task RunAsync(string, IEnumerable?, bool, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-string-system-collections-generic-ienumerable((system-string))-system-boolean-system-threading-cancellationtoken)) * Note: When silent is true, standard output and error are suppressed by redirecting and discarding them (rather than binding to the null device as on net11); standard input remains connected. * `int StartAndForget(ProcessStartInfo)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-diagnostics-processstartinfo)) - * `int StartAndForget(string, IList?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-string-system-collections-generic-ilist((system-string)))) + * `int StartAndForget(string, IEnumerable?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-string-system-collections-generic-ienumerable((system-string)))) * `bool TryGetProcessById(int, Process?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.trygetprocessbyid?view=net-11.0) diff --git a/readme.md b/readme.md index ef5c9178..c970e656 100644 --- a/readme.md +++ b/readme.md @@ -1419,17 +1419,17 @@ The class `Polyfill` includes the following extension methods: * `Task WaitForExitStatusAsync(CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.waitforexitstatusasync?view=net-11.0) * Note: On Unix the terminating signal is derived from the exit code, which is 128 plus the signal number, instead of from the raw wait status. A process that exits normally with, for example, code 143 is therefore reported as terminated by SIGTERM. * `ProcessExitStatus Run(ProcessStartInfo, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-diagnostics-processstartinfo-system-nullable((system-timespan)))) - * `ProcessExitStatus Run(string, IList?, bool, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-string-system-collections-generic-ilist((system-string))-system-boolean-system-nullable((system-timespan)))) + * `ProcessExitStatus Run(string, IEnumerable?, bool, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-string-system-collections-generic-ienumerable((system-string))-system-boolean-system-nullable((system-timespan)))) * Note: When silent is true, standard output and error are suppressed by redirecting and discarding them (rather than binding to the null device as on net11); standard input remains connected. * `ProcessTextOutput RunAndCaptureText(ProcessStartInfo, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-diagnostics-processstartinfo-system-nullable((system-timespan)))) - * `ProcessTextOutput RunAndCaptureText(string, IList?, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-string-system-collections-generic-ilist((system-string))-system-nullable((system-timespan)))) + * `ProcessTextOutput RunAndCaptureText(string, IEnumerable?, TimeSpan?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-string-system-collections-generic-ienumerable((system-string))-system-nullable((system-timespan)))) * `Task RunAndCaptureTextAsync(ProcessStartInfo, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-diagnostics-processstartinfo-system-threading-cancellationtoken)) - * `Task RunAndCaptureTextAsync(string, IList?, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-string-system-collections-generic-ilist((system-string))-system-threading-cancellationtoken)) + * `Task RunAndCaptureTextAsync(string, IEnumerable?, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-string-system-collections-generic-ienumerable((system-string))-system-threading-cancellationtoken)) * `Task RunAsync(ProcessStartInfo, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-diagnostics-processstartinfo-system-threading-cancellationtoken)) - * `Task RunAsync(string, IList?, bool, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-string-system-collections-generic-ilist((system-string))-system-boolean-system-threading-cancellationtoken)) + * `Task RunAsync(string, IEnumerable?, bool, CancellationToken)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-string-system-collections-generic-ienumerable((system-string))-system-boolean-system-threading-cancellationtoken)) * Note: When silent is true, standard output and error are suppressed by redirecting and discarding them (rather than binding to the null device as on net11); standard input remains connected. * `int StartAndForget(ProcessStartInfo)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-diagnostics-processstartinfo)) - * `int StartAndForget(string, IList?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-string-system-collections-generic-ilist((system-string)))) + * `int StartAndForget(string, IEnumerable?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-string-system-collections-generic-ienumerable((system-string)))) * `bool TryGetProcessById(int, Process?)` [reference](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.trygetprocessbyid?view=net-11.0) diff --git a/src/Consume/Consume.cs b/src/Consume/Consume.cs index 57cb93d2..f26c62db 100644 --- a/src/Consume/Consume.cs +++ b/src/Consume/Consume.cs @@ -1383,6 +1383,14 @@ async Task Process_Methods() } #endif + // arguments is IEnumerable on net11, so a non-list sequence has to bind + IEnumerable argumentSequence = new HashSet { "a", "b" }; + _ = Process.Run("notexists", argumentSequence); + _ = await Process.RunAsync("notexists", argumentSequence); + _ = Process.RunAndCaptureText("notexists", argumentSequence); + _ = await Process.RunAndCaptureTextAsync("notexists", argumentSequence); + _ = Process.StartAndForget("notexists", argumentSequence); + ProcessExitStatus status = Process.Run("notexists"); status = Process.Run("notexists", new[] { "a", "b" }); status = Process.Run("notexists", new[] { "a", "b" }, silent: true); diff --git a/src/Polyfill/ProcessPolyfill.cs b/src/Polyfill/ProcessPolyfill.cs index 806c1e05..c6ff07ac 100644 --- a/src/Polyfill/ProcessPolyfill.cs +++ b/src/Polyfill/ProcessPolyfill.cs @@ -31,12 +31,12 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou /// /// Starts the process described by and , waits for it to exit, and returns the exit status. /// - //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-string-system-collections-generic-ilist((system-string))-system-boolean-system-nullable((system-timespan))) + //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.run?view=net-11.0#system-diagnostics-process-run(system-string-system-collections-generic-ienumerable((system-string))-system-boolean-system-nullable((system-timespan))) //Note: When silent is true, standard output and error are suppressed by redirecting and discarding them (rather than binding to the null device as on net11); standard input remains connected. [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -85,12 +85,12 @@ public static async Task RunAsync(ProcessStartInfo startInfo, /// /// Asynchronously starts the process described by and , waits for it to exit, and returns the exit status. /// - //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-string-system-collections-generic-ilist((system-string))-system-boolean-system-threading-cancellationtoken) + //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runasync?view=net-11.0#system-diagnostics-process-runasync(system-string-system-collections-generic-ienumerable((system-string))-system-boolean-system-threading-cancellationtoken) //Note: When silent is true, standard output and error are suppressed by redirecting and discarding them (rather than binding to the null device as on net11); standard input remains connected. [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -122,11 +122,11 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti /// /// Starts the process described by and , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. /// - //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-string-system-collections-generic-ilist((system-string))-system-nullable((system-timespan))) + //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetext?view=net-11.0#system-diagnostics-process-runandcapturetext(system-string-system-collections-generic-ienumerable((system-string))-system-nullable((system-timespan))) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// @@ -167,11 +167,11 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI /// /// Asynchronously starts the process described by and , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. /// - //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-string-system-collections-generic-ilist((system-string))-system-threading-cancellationtoken) + //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.runandcapturetextasync?view=net-11.0#system-diagnostics-process-runandcapturetextasync(system-string-system-collections-generic-ienumerable((system-string))-system-threading-cancellationtoken) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// @@ -197,11 +197,11 @@ public static int StartAndForget(ProcessStartInfo startInfo) /// /// Starts the process described by and in detached fashion and returns its process identifier. /// - //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-string-system-collections-generic-ilist((system-string))) + //Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.startandforget?view=net-11.0#system-diagnostics-process-startandforget(system-string-system-collections-generic-ienumerable((system-string))) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// @@ -231,7 +231,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -247,7 +247,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net10.0/ProcessPolyfill.cs b/src/Split/net10.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net10.0/ProcessPolyfill.cs +++ b/src/Split/net10.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net461/ProcessPolyfill.cs b/src/Split/net461/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net461/ProcessPolyfill.cs +++ b/src/Split/net461/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net462/ProcessPolyfill.cs b/src/Split/net462/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net462/ProcessPolyfill.cs +++ b/src/Split/net462/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net47/ProcessPolyfill.cs b/src/Split/net47/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net47/ProcessPolyfill.cs +++ b/src/Split/net47/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net471/ProcessPolyfill.cs b/src/Split/net471/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net471/ProcessPolyfill.cs +++ b/src/Split/net471/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net472/ProcessPolyfill.cs b/src/Split/net472/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net472/ProcessPolyfill.cs +++ b/src/Split/net472/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net48/ProcessPolyfill.cs b/src/Split/net48/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net48/ProcessPolyfill.cs +++ b/src/Split/net48/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net481/ProcessPolyfill.cs b/src/Split/net481/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net481/ProcessPolyfill.cs +++ b/src/Split/net481/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net5.0/ProcessPolyfill.cs b/src/Split/net5.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net5.0/ProcessPolyfill.cs +++ b/src/Split/net5.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net6.0/ProcessPolyfill.cs b/src/Split/net6.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net6.0/ProcessPolyfill.cs +++ b/src/Split/net6.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net7.0/ProcessPolyfill.cs b/src/Split/net7.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net7.0/ProcessPolyfill.cs +++ b/src/Split/net7.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net8.0/ProcessPolyfill.cs b/src/Split/net8.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net8.0/ProcessPolyfill.cs +++ b/src/Split/net8.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/net9.0/ProcessPolyfill.cs b/src/Split/net9.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/net9.0/ProcessPolyfill.cs +++ b/src/Split/net9.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/netcoreapp2.0/ProcessPolyfill.cs b/src/Split/netcoreapp2.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/netcoreapp2.0/ProcessPolyfill.cs +++ b/src/Split/netcoreapp2.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/netcoreapp2.1/ProcessPolyfill.cs b/src/Split/netcoreapp2.1/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/netcoreapp2.1/ProcessPolyfill.cs +++ b/src/Split/netcoreapp2.1/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/netcoreapp2.2/ProcessPolyfill.cs b/src/Split/netcoreapp2.2/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/netcoreapp2.2/ProcessPolyfill.cs +++ b/src/Split/netcoreapp2.2/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/netcoreapp3.0/ProcessPolyfill.cs b/src/Split/netcoreapp3.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/netcoreapp3.0/ProcessPolyfill.cs +++ b/src/Split/netcoreapp3.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/netcoreapp3.1/ProcessPolyfill.cs b/src/Split/netcoreapp3.1/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/netcoreapp3.1/ProcessPolyfill.cs +++ b/src/Split/netcoreapp3.1/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/netstandard2.0/ProcessPolyfill.cs b/src/Split/netstandard2.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/netstandard2.0/ProcessPolyfill.cs +++ b/src/Split/netstandard2.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/netstandard2.1/ProcessPolyfill.cs b/src/Split/netstandard2.1/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/netstandard2.1/ProcessPolyfill.cs +++ b/src/Split/netstandard2.1/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo { diff --git a/src/Split/uap10.0/ProcessPolyfill.cs b/src/Split/uap10.0/ProcessPolyfill.cs index 55af4bca..1a659f9e 100644 --- a/src/Split/uap10.0/ProcessPolyfill.cs +++ b/src/Split/uap10.0/ProcessPolyfill.cs @@ -30,7 +30,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { if (silent) { @@ -76,7 +76,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { if (silent) { @@ -107,7 +107,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) => + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => Process.RunAndCaptureText(BuildStartInfo(fileName, arguments), timeout); /// /// Asynchronously starts the process described by , captures its standard output and standard error as text, waits for it to exit, and returns the captured output. @@ -148,7 +148,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) => + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => Process.RunAndCaptureTextAsync(BuildStartInfo(fileName, arguments), cancellationToken); /// /// Starts the process described by in detached fashion and returns its process identifier. @@ -174,7 +174,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [SupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] - public static int StartAndForget(string fileName, IList? arguments = null) => + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => Process.StartAndForget(BuildStartInfo(fileName, arguments)); /// /// Gets the associated with the specified process identifier, and returns a value that indicates whether the operation succeeded. @@ -200,7 +200,7 @@ public static bool TryGetProcessById(int processId, [NotNullWhen(true)] out Proc } } } - static async Task RunSilentAsync(string fileName, IList? arguments, CancellationToken cancellationToken) + static async Task RunSilentAsync(string fileName, IEnumerable? arguments, CancellationToken cancellationToken) { var output = await Process.RunAndCaptureTextAsync(fileName, arguments, cancellationToken); return output.ExitStatus; @@ -214,7 +214,7 @@ static Process StartOrThrow(ProcessStartInfo startInfo) } return process; } - static ProcessStartInfo BuildStartInfo(string fileName, IList? arguments) + static ProcessStartInfo BuildStartInfo(string fileName, IEnumerable? arguments) { var info = new ProcessStartInfo {