-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Diagnostics.Processgood first issueIssue should be easy to implement, good for first-time contributorsIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Milestone
Description
Background and motivation
Starting a process should be easy when you have an IEnumerable<string> with arguments.
This is true if you can use the static Process.Start overload that accepts an IEnumerable.
If you need to use ProcessStartInfo to make additional configuration, like redirecting the streams, there is no way to pass in the IEnumerable<string>.
Process.ArgumentList is a Collection<string>. Because it doesn't have an AddRange, the user needs to add a loop to add the arguments one-by-one.
API Proposal
A constructor can be added to ProcessStartInfo.
ProcessStartInfo(string fileName, IEnumerable<string> arguments)This is consistent with rest of the API of Process where IEnumerable<string> overloads were added to existing APIs that accepted string arguments.
API Usage
ProcessStartInfo psi = new("filename", GetArguments());Alternative designs
Risks
somebody1234, amongonz and nil4
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Diagnostics.Processgood first issueIssue should be easy to implement, good for first-time contributorsIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors