Add PowerShell as an Optional Tool From the Microsoft Feed - #782
Conversation
powershell joins the managed registry as the one optional member, selected under --optional or by name, and installs from Microsoft's apt repository, the feed dotnet already falls back to. The feed registration moves into a shared microsoft_feed so both tools reach it, and a host with the feed unconfigured reads a report note rather than a silent absence.
There was a problem hiding this comment.
Pull request overview
Adds PowerShell (pwsh) as an optional, opt-in tool managed by the Linux host-setup installer, using Microsofts apt feed (shared with the existing dotnet fallback path). Updates docs to describe the new source taxonomy and optional behavior.
Changes:
- Extend
install-tools.shwith a newpowershelltool (optional by default, included under--optionalor when explicitly named). - Factor Microsoft apt repo registration into a shared
microsoft_feed()helper used by bothdotnetandpowershell. - Update host setup documentation to mention PowerShell and its source/feed behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| host-setup/linux/README.md | Documents PowerShell as an upstream-apt-repo sourced tool and explains its optional, opt-in status. |
| host-setup/linux/install-tools.sh | Implements PowerShell install/report/list behavior and shares Microsoft feed registration with dotnet. |
| docs/host-setup.md | Updates the host-tool sourcing narrative to include pwsh and clarifies it is not part of the default contract table. |
Suppressed comments (1)
host-setup/linux/install-tools.sh:689
- microsoft_feed() always runs dpkg -i and marks the apt lists dirty, which forces an apt-get update even when Microsoft's repo is already configured. That breaks the script's stated idempotence goal (refresh only when sources change) and adds unnecessary network work on repeated runs or when both dotnet and powershell call it in one run. Add a fast-path that detects an existing microsoft-prod sources/list file and only refreshes the apt cache (without setting APT_DIRTY) when already configured.
microsoft_feed() {
local deb="$TMP_DIR/packages-microsoft-prod.deb"
fetch -o "$deb" "https://packages.microsoft.com/config/$DISTRO_ID/$DISTRO_VERSION/packages-microsoft-prod.deb" ||
die "Microsoft publishes no feed for $DISTRO_ID $DISTRO_VERSION"
run_root dpkg -i "$deb"
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The host-setup doc now says pwsh is the command the powershell tool provides, so a reader knows what to pass to install-tools.sh to opt in. microsoft_feed returns early when the feed is already configured, so a repeat run or one selecting both dotnet and powershell does not re-install the deb and force an apt refresh.
|
Suppressed finding (1) from the round on 763209f, at host-setup/linux/install-tools.sh:689:
Fixed in 5995217. microsoft_feed now returns early when Review round: #782 (review) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (3)
host-setup/linux/install-tools.sh:694
- microsoft_feed() aborts the entire run when the feed URL is missing (die "Microsoft publishes no feed..."). The script's contract (and README) says install/upgrade should collect per-tool failures and continue, and making powershell selectable via --optional increases the chance that an unsupported feed turns a full tools run into a hard stop. Consider returning a non-zero status instead of exiting so the caller can record a tool failure and keep going.
local deb="$TMP_DIR/packages-microsoft-prod.deb"
fetch -o "$deb" "https://packages.microsoft.com/config/$DISTRO_ID/$DISTRO_VERSION/packages-microsoft-prod.deb" ||
die "Microsoft publishes no feed for $DISTRO_ID $DISTRO_VERSION"
run_root dpkg -i "$deb"
host-setup/linux/install-tools.sh:734
- powershell_install() calls microsoft_feed without guarding its exit status. If microsoft_feed is adjusted to return non-zero instead of exiting on an unsupported feed, this call site should handle that failure explicitly so the script does not terminate under errexit and so the tool failure can be collected.
microsoft_feed
apt_install powershell
}
host-setup/linux/install-tools.sh:680
- If microsoft_feed() is changed to return non-zero on failure (instead of exiting), dotnet_feed() should explicitly propagate that failure; otherwise errexit handling becomes dependent on bash's conditional-list semantics. Guarding the call also makes the intended control flow clearer.
This issue also appears on line 731 of the same file.
fi
microsoft_feed
}
|
Suppressed findings (3) from the round on 5995217, all one proposal: 1. host-setup/linux/install-tools.sh:694 - Declined: this is the tracked migration, not a powershell fix. Ending the run on an upstream lookup that cannot be answered is this script's current, documented behavior for its sibling tools: 2. host-setup/linux/install-tools.sh:734 - Declined: conditional on finding 1. Today 3. host-setup/linux/install-tools.sh:680 - Declined: same reason as finding 1. Review round: #782 (review) |
… Fix (#786) Promote `develop` to `main`, carrying: - #783 Drop IGNORE_GITHUB_REF From the Hosted Get-Version Task (the hosted task follows WORKFLOW.md D3.1 like the inline get-version job already does) - #778 Name the Executable Asset for Its Project and Record the PhotoCleaner Pilot (the executable default names its archive for the project file, the publish-release snippet and doc stub carry explicit permissions, PhotoCleaner ticked as the stage 2 and 4 pilot) - #775 Record 2.0.352 in the Reusable-Workflow Rollout and Add Its Catalog Snippets - #773 Expand references/ in large skill files for progressive disclosure - #776 Make the linux host-setup scripts refuse more than one action - #782 Add PowerShell as an Optional Tool From the Microsoft Feed The release that follows is the pin PhotoCleaner's Dependabot bumps to, and PhotoCleaner's next release through it is the proof that the executable asset is named `PhotoCleaner.7z` again. Closes #769.
What
Adds
powershellto the host toolsinstall-tools.shmanages, as the one optional member. It installs from Microsoft's apt repository, the same feeddotnetalready falls back to, so no separate download step is needed (the path HomeAutomation-Config's PR #56 took with a tar.gz build).install-tools.sh --optional(or a stand-up's--optionaltools step) now also installspwsh.install-tools.sh --install powershell) selects it regardless of--optional.microsoft_feed(), used by bothdotnetandpowershell;dotnet's behavior is unchanged.--listmarks it(optional), and the report notes when Microsoft's repository is not configured.dotnet.Verified: shellcheck, prose_lint, markdownlint, and editorconfig are clean, and all 686 tests in
scripts/testspass. On a Debian 13 host the report showspowershell 7.6.5-1.debavailable frompackages.microsoft.com, and a default report (without--optional) omits it.Docs
host-setup/linux/README.mdsource taxonomy and the docker/node/dotnet section.docs/host-setup.mdsource paragraph and the "not in the table" sentence.