fix(provision): install pwsh user profile after modules; Az on Linux - #258
Conversation
Bump aliases-git 1.23.1 -> 1.24.0 (synced from ps-modules).
Move current-user profile setup to run after user-scope modules are copied, so completers gated on module functions (Register-MakeCompleter in do-unix) resolve on first install. Also install the Az PowerShell modules on the Linux path when the az scope is selected, matching wsl_setup.ps1.
There was a problem hiding this comment.
Pull request overview
This PR adjusts provisioning order so PowerShell user profiles are set up after user-scope modules are installed (fixing first-provision missing completer blocks), ensures Az PowerShell modules are installed for Linux provisions when the az scope is selected, and syncs aliases-git to add a -NoVerify switch for skipping git hooks.
Changes:
- Move current-user PowerShell profile setup to after user module installation in both WSL and Linux orchestrators.
- Install
Az/Az.ResourceGraphon Linux whenazscope is selected (sodo-azis importable). - Bump
aliases-gitto1.24.0and add-NoVerifyplumbing to append--no-verify.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
wsl/wsl_setup.ps1 |
Runs setup_profile_user.ps1 after copying user modules so gated profile blocks resolve on first provision. |
.assets/scripts/linux_setup.sh |
Runs setup_profile_user.ps1 after module copy; installs Az modules when az scope is present. |
modules/aliases-git/Functions/internal.ps1 |
Adds -NoVerify to Invoke-WriteExecCommand to append --no-verify. |
modules/aliases-git/Functions/helper.ps1 |
Adds -NoVerify support to helper commands (primarily to affect pushes). |
modules/aliases-git/Functions/alias.ps1 |
Adds -NoVerify across commit/push aliases (but some wrappers currently drop it for the commit step). |
modules/aliases-git/aliases-git.psd1 |
Bumps module version to 1.24.0. |
Comments suppressed due to low confidence (7)
modules/aliases-git/Functions/alias.ps1:344
- gacp -NoVerify currently removes NoVerify before calling gac, so the commit portion still runs hooks (only the subsequent push is no-verify). Pass -NoVerify through when invoking gac.
$PSBoundParameters.Remove('NoVerify') | Out-Null
gac @PSBoundParameters
modules/aliases-git/Functions/alias.ps1:420
- gcamp -NoVerify removes NoVerify before calling gcam, so the commit still runs hooks and only the push skips them. Pass -NoVerify through to gcam.
$PSBoundParameters.Remove('NoVerify') | Out-Null
gcam @PSBoundParameters
modules/aliases-git/Functions/alias.ps1:462
- gacmp -NoVerify removes NoVerify before calling gacm, so the commit still runs hooks and only the push skips them. Pass -NoVerify through to gacm.
$PSBoundParameters.Remove('NoVerify') | Out-Null
gacm @PSBoundParameters
modules/aliases-git/Functions/alias.ps1:500
- gcanp! -NoVerify removes NoVerify before calling gcan!, so the amend commit still runs hooks and only the subsequent push uses --no-verify. Pass -NoVerify through to gcan!.
$PSBoundParameters.Remove('NoVerify') | Out-Null
gcan! @PSBoundParameters
modules/aliases-git/Functions/alias.ps1:559
- gacnp! -NoVerify removes NoVerify before calling gacn!, so the commit still runs hooks and only the push skips them. Pass -NoVerify through to gacn!.
$PSBoundParameters.Remove('NoVerify') | Out-Null
gacn! @PSBoundParameters
modules/aliases-git/Functions/alias.ps1:652
- gcmsgp -NoVerify removes NoVerify before calling gcmsg, so the commit still runs hooks and only the push uses --no-verify. Pass -NoVerify through to gcmsg.
$PSBoundParameters.Remove('NoVerify') | Out-Null
gcmsg @PSBoundParameters
modules/aliases-git/Functions/alias.ps1:690
- gcnp! -NoVerify removes NoVerify before calling gcn!, so the amend commit still runs hooks and only the push uses --no-verify. Pass -NoVerify through to gcn!.
$PSBoundParameters.Remove('NoVerify') | Out-Null
gcn! @PSBoundParameters
Summary
setup_profile_user.ps1gates the make-completer block onRegister-MakeCompleterbeing importable fromdo-unixat provisioning time, but both orchestrators ran the profile setup before the user-scope modules were copied. On a first install the module wasn't on disk yet, so the block was never written (it only appeared on a re-provision). Moved the current-user profile setup to run after the module install in bothlinux_setup.shandwsl_setup.ps1. No change tosetup_profile_user.ps1— the existing gate now resolves correctly, with no shell-startup cost.do-az(installed on theazscope) declaresAz.Accounts/Az.ResourceGraphasRequiredModules, but onlywsl_setup.ps1installed them — a bare-metal/VM/WSL-guest provision vialinux_setup.shleftdo-aznon-importable. Added theAz/Az.ResourceGraphinstall tolinux_setup.sh, in the final pwsh block aftersetup_profile_user.ps1(so PSGallery is trusted) and afterdo-common(forInvoke-CommandRetry), gated on theazscope — mirroringwsl_setup.ps1.aliases-git→1.24.0(synced fromps-modules). Adds a-NoVerifyswitch across the git commit/push alias functions to skip pre-commit/pre-push hooks. Synced-module change, reviewed upstream.Test plan
make lint-diff— all pre-commit hooks greenpwshscope: confirm#region make completeris written to$PROFILE.CurrentUserAllHostsandm <tab>completes Makefile targetsazscope: confirmImport-Module do-azsucceeds (Az.Accounts/Az.ResourceGraph present)Select-Stringguards)🤖 Generated with Claude Code