Skip to content

fix: config func - #9195

Open
Tim Wright (timmy-wright) wants to merge 1 commit into
mainfrom
timmy/configfunc
Open

fix: config func#9195
Tim Wright (timmy-wright) wants to merge 1 commit into
mainfrom
timmy/configfunc

Conversation

@timmy-wright

Copy link
Copy Markdown
Contributor

Harden config func

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

@github-actions

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   12 suites   41s ⏱️
395 tests 347 ✅ 0 💤 48 ❌
398 runs  350 ✅ 0 💤 48 ❌

For more details on these failures, see this check.

Results for commit bb0e673.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to harden Windows CSE configfunc.ps1 by adding stricter error handling around external command invocations and improving service install idempotency, with accompanying Pester test updates in the staging Windows CSE package.

Changes:

  • Added $LASTEXITCODE checks (and some fail-fast behavior) after sc.exe, reg.exe import, and icacls operations.
  • Refactored New-CsiProxyService / New-HostsConfigService to remove an existing service before reinstalling and to use an Invoke-Nssm helper (with new unit tests).
  • Reformatted/cleaned up portions of the Pester tests and added service-install coverage for csi-proxy and hosts-config-agent.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
staging/cse/windows/configfunc.ps1 Adds command exit-code hardening; refactors service creation to rely on new helper(s).
staging/cse/windows/configfunc.tests.ps1 Adds/updates Pester tests, including new coverage for service creation behaviors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1 to 2
. $PSScriptRoot\helpers.ps1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants