Skip to content

Add GitHub CLI and Copilot CLI updates to Update-AllTheThings - #231

Merged
SamErde merged 32 commits into
mainfrom
copilot/update-allthethings-feature
Sep 14, 2026
Merged

SamErde merged 32 commits into
mainfrom
copilot/update-allthethings-feature

Conversation

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Update-AllTheThings did not update installed GitHub CLI extensions or the GitHub Copilot CLI even when those tools were present. This change adds those update paths and keeps the existing Windows/WinGet safety behavior aligned with non-interactive usage.

  • CLI updater coverage

    • Add optional GitHub CLI extension upgrades via gh extension upgrade --all
    • Add optional GitHub Copilot CLI upgrades via copilot update
    • Reuse a shared helper for optional CLI tools so detection, progress reporting, and ShouldProcess behavior stay consistent
  • Windows / WinGet safeguard tightening

    • Keep the Windows Server confirmation scoped to WinGet updates
    • Avoid prompting during -WhatIf
    • Honor -Confirm:$false and -AcceptPrompts for unattended runs
    • Fall back from CIM to WMI for server detection, and skip WinGet safely if OS detection is unavailable
  • Published script + docs parity

    • Regenerate the packaged Scripts/Update-AllTheThings.ps1
    • Update script metadata/help text to mention GitHub CLI extensions and GitHub Copilot CLI
    • Replace the stale related-links placeholder in the cmdlet doc
  • Behavioral regression coverage

    • Add Pester coverage for:
      • gh present / absent
      • copilot present / absent
      • WhatIf suppressing CLI execution
      • Windows Server prompt yes/no behavior
      • CIM failure and WMI fallback
      • packaged script safeguard behavior
if (Get-Command -Name 'gh' -ErrorAction SilentlyContinue) {
    gh extension upgrade --all
}

if (Get-Command -Name 'copilot' -ErrorAction SilentlyContinue) {
    copilot update
}

Copilot AI and others added 26 commits September 13, 2026 22:26
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>
Add read-only pull request validation, deterministic dependency locking, current action pins, deployment guards, caching, and job timeouts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: fe49b45b-da61-4a95-b8bf-5f768e7e9ea4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SamErde
SamErde marked this pull request as ready for review September 14, 2026 01:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T14:26:18.770042Z 9692872 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions
github-actions Bot requested a review from SamErde September 14, 2026 01:42
@SamErde
SamErde requested a lite review from Copilot and removed request for SamErde September 14, 2026 01:42
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3b91424a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Scripts/Update-AllTheThings.ps1 Resolved
@codacy-production

codacy-production Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

🟡 Changes recommended

Unresolved standalone telemetry and WinGet safety-gating issues, along with confirmation-path concerns, block approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Extends Update-AllTheThings to update GitHub CLI tools, strengthen WinGet safeguards, and synchronize scripts, documentation, and tests.

Changes:

  • Adds optional gh extension and Copilot CLI updates.
  • Adds CIM/WMI OS detection and unattended Windows Server safeguards.
  • Updates packaged scripts, metadata, documentation, and regression coverage.
File summaries
File Summary
src/Tests/Unit/Update-AllTheThings.Tests.ps1 Adds CLI and safeguard regression tests.
src/PSPreworkout/Public/Update-AllTheThings.ps1 Adds CLI update logic and WinGet safeguards.
src/PSPreworkout/Public/Test-IsElevated.ps1 Corrects Unix group detection.
Scripts/Update-AllTheThings.ps1 Regenerated standalone published script.
Scripts/Update-AllTheThings_ScriptInfo.ps1 Updates script metadata.
docs/Update-AllTheThings.md Updates documentation and related links.
Review details

Suppressed comments (3)

Scripts/Update-AllTheThings.ps1:386

  • The packaged copy repeats the same gating problem: when -AcceptPrompts, -Confirm:$false, or built-in confirmation handling suppresses the custom prompt, CIM/WMI detection is not attempted and WinGet can run with an unknown OS caption. Keep OS detection and the safety skip independent from the decision to show the interactive server prompt.
            $NeedServerPrompt = $WinGetCommand -and (-not $SkipWinGet) -and (-not $SkipServerPrompt) -and (-not $ShouldProcessHandlesConsent)

src/PSPreworkout/Public/Update-AllTheThings.ps1:329

  • Get-HostChoice is not a PSPreworkout command; this test hook is now part of the production confirmation path. If a caller has any function or cmdlet with that name, it replaces $Host.UI.PromptForChoice and can return an unexpected value or bypass the Windows Server safety prompt. Keep production code on the host API and inject/mock the prompt without resolving an arbitrary caller command.
                if (Get-Command -Name 'Get-HostChoice' -ErrorAction SilentlyContinue) {
                    $Result = Get-HostChoice -Title $Title -Message $Message -Options $Options -DefaultChoice 1
                } else {
                    $Result = $Host.UI.PromptForChoice($Title, $Message, $Options, 1)

src/PSPreworkout/Public/Update-AllTheThings.ps1:284

  • The OS-caption safety check is gated by $NeedServerPrompt, so it is skipped when -AcceptPrompts, -Confirm:$false, or a standard ShouldProcess confirmation is used. If both CIM and WMI are unavailable in any of those modes, $ShouldUpdateWinGet can still be true and WinGet runs despite the stated safety requirement to skip when the OS cannot be determined. Separate OS detection from whether the interactive server-choice prompt is needed.
            $NeedServerPrompt = $WinGetCommand -and (-not $SkipWinGet) -and (-not $SkipServerPrompt) -and (-not $ShouldProcessHandlesConsent)
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Lite

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

Comment thread Scripts/Update-AllTheThings.ps1 Resolved
Co-authored-by: SamErde <20478745+SamErde@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdd2065383

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Scripts/Update-AllTheThings.ps1 Resolved
SamErde and others added 2 commits September 14, 2026 08:45
Extract platform and native-command seams, split the Pester suite by responsibility, add cross-version CI coverage, and make standalone packaging deterministic.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Extract package-manager and PowerShell update stages into focused private helpers, centralize progress and native command handling, and expand cross-version Pester coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

The standalone script still invokes a module-private telemetry helper through its bundled elevation function.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread Scripts/Update-AllTheThings.ps1 Resolved
SamErde and others added 2 commits September 14, 2026 10:18
Emit deterministic CRLF output to match the repository PowerShell line-ending policy and keep byte-parity checks stable across CI hosts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Suppress the analyzer false positive on the public orchestrator because confirmation is forwarded to private helpers, and cover the contract in Pester.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@SamErde
SamErde merged commit e669fd5 into main Sep 14, 2026
16 checks passed
@SamErde
SamErde deleted the copilot/update-allthethings-feature branch September 14, 2026 14:45
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.

4 participants