Add Process.Start and update StartShellExecute to accept arguments#73
Add Process.Start and update StartShellExecute to accept arguments#73
Conversation
…to accept arguments Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/34c19623-d695-45a6-86be-b84c3f5752b7 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/99e79a52-c88c-4b58-bb36-ccb97b494ddb Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends PowerKit.Extensions.ProcessExtensions with additional process-starting helpers, adding a new Process.Start(...) extension that accepts an argument list and updating StartShellExecute to accept optional arguments.
Changes:
- Added
Process.Start(string, IReadOnlyList<string>?)extension that starts a process and (when available) populatesProcessStartInfo.ArgumentList. - Updated
StartShellExecuteto accept an optional argument list and changed its return type tovoidon newer TFMs (with anet35fallback). - Added tests to exercise the new
StartAPI.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| PowerKit/Extensions/ProcessExtensions.cs | Adds new Start extension and updates StartShellExecute to optionally accept argument lists with TFM guards. |
| PowerKit.Tests/Extensions/ProcessExtensionsTests.cs | Adds tests for the new Start overload(s). |
Comments suppressed due to low confidence (1)
PowerKit.Tests/Extensions/ProcessExtensionsTests.cs:46
Start_WithoutArguments_TestcallsProcess.Start("dotnet"), which will bind to the BCL overloadProcess.Start(string)rather than the new extension member (since the framework member is applicable). As a result this test doesn’t cover the new API. If the intent is to validate the extension method’s no-arguments behavior, call it with an explicit second argument (e.g.,Process.Start("dotnet", (IReadOnlyList<string>?)null)or an empty list).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## prime #73 +/- ##
==========================================
- Coverage 93.85% 93.71% -0.15%
==========================================
Files 128 132 +4
Lines 2524 2658 +134
Branches 200 212 +12
==========================================
+ Hits 2369 2491 +122
- Misses 112 123 +11
- Partials 43 44 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot formatting issues |
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/abe53400-098b-4de8-b87a-0827b3703de8 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
|
@copilot build is failing |
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/7f7446de-fb17-4c4c-aeea-f5980c4a0369 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/4e29b38e-424d-4fb8-bbfd-0586b433b3f2 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Start_WithoutArguments_Test#ifguard aroundusing System.Collections.Generic;Process.Startto returnProcess#elseargument-string fallback for bothStartandStartShellExecuteStart_Testto be async and assertExitCode == 0StartShellExecute's#elsebranch now correctly usesstartInfo.Argumentsinstead ofprocess.StartInfo.Arguments