Skip to content

Add Process.Start and update StartShellExecute to accept arguments#73

Merged
Tyrrrz merged 8 commits intoprimefrom
copilot/add-process-extensions
Apr 19, 2026
Merged

Add Process.Start and update StartShellExecute to accept arguments#73
Tyrrrz merged 8 commits intoprimefrom
copilot/add-process-extensions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

  • Remove redundant Start_WithoutArguments_Test
  • Remove #if guard around using System.Collections.Generic;
  • Change Process.Start to return Process
  • Add #else argument-string fallback for both Start and StartShellExecute
  • Update Start_Test to be async and assert ExitCode == 0
  • Fix CS0103: StartShellExecute's #else branch now correctly uses startInfo.Arguments instead of process.StartInfo.Arguments

…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>
@Tyrrrz Tyrrrz added the enhancement New feature or request label Apr 19, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review April 19, 2026 10:28
Copilot AI review requested due to automatic review settings April 19, 2026 10:28
Comment thread PowerKit.Tests/Extensions/ProcessExtensionsTests.cs Outdated
Comment thread PowerKit.Tests/Extensions/ProcessExtensionsTests.cs Outdated
Comment thread PowerKit/Extensions/ProcessExtensions.cs Outdated
Comment thread PowerKit/Extensions/ProcessExtensions.cs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) populates ProcessStartInfo.ArgumentList.
  • Updated StartShellExecute to accept an optional argument list and changed its return type to void on newer TFMs (with a net35 fallback).
  • Added tests to exercise the new Start API.

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_Test calls Process.Start("dotnet"), which will bind to the BCL overload Process.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.

Comment thread PowerKit/Extensions/ProcessExtensions.cs Outdated
Comment thread PowerKit/Extensions/ProcessExtensions.cs Outdated
Comment thread PowerKit/Extensions/ProcessExtensions.cs Outdated
Comment thread PowerKit/Extensions/ProcessExtensions.cs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

❌ Patch coverage is 31.25000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.71%. Comparing base (45628b8) to head (0b12ba8).
⚠️ Report is 8 commits behind head on prime.

Files with missing lines Patch % Lines
PowerKit/Extensions/ProcessExtensions.cs 0.00% 11 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 19, 2026

@copilot formatting issues

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 19, 2026

@copilot build is failing

Comment thread PowerKit/Extensions/ProcessExtensions.cs Outdated
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/4e29b38e-424d-4fb8-bbfd-0586b433b3f2

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
@Tyrrrz Tyrrrz requested a review from Copilot April 19, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants