Skip to content

fix(provision): install pwsh user profile after modules; Az on Linux - #258

Merged
szymonos merged 2 commits into
mainfrom
rfr/pwsh-profile-order
Jul 23, 2026
Merged

fix(provision): install pwsh user profile after modules; Az on Linux#258
szymonos merged 2 commits into
mainfrom
rfr/pwsh-profile-order

Conversation

@szymonos

Copy link
Copy Markdown
Owner

Summary

  • Make completer never installed on first provision. setup_profile_user.ps1 gates the make-completer block on Register-MakeCompleter being importable from do-unix at 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 both linux_setup.sh and wsl_setup.ps1. No change to setup_profile_user.ps1 — the existing gate now resolves correctly, with no shell-startup cost.
  • Az PowerShell modules not installed on the Linux path. do-az (installed on the az scope) declares Az.Accounts/Az.ResourceGraph as RequiredModules, but only wsl_setup.ps1 installed them — a bare-metal/VM/WSL-guest provision via linux_setup.sh left do-az non-importable. Added the Az/Az.ResourceGraph install to linux_setup.sh, in the final pwsh block after setup_profile_user.ps1 (so PSGallery is trusted) and after do-common (for Invoke-CommandRetry), gated on the az scope — mirroring wsl_setup.ps1.
  • aliases-git1.24.0 (synced from ps-modules). Adds a -NoVerify switch 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 green
  • First-time WSL provision with pwsh scope: confirm #region make completer is written to $PROFILE.CurrentUserAllHosts and m <tab> completes Makefile targets
  • Linux (non-WSL) provision with az scope: confirm Import-Module do-az succeeds (Az.Accounts/Az.ResourceGraph present)
  • Re-provision an already-set-up distro: confirm no duplicate profile blocks (idempotent Select-String guards)

🤖 Generated with Claude Code

szymonos added 2 commits July 23, 2026 08:53
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.

Copilot AI 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.

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.ResourceGraph on Linux when az scope is selected (so do-az is importable).
  • Bump aliases-git to 1.24.0 and add -NoVerify plumbing 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

Comment thread modules/aliases-git/Functions/alias.ps1
@szymonos
szymonos merged commit ee4397e into main Jul 23, 2026
3 checks passed
@szymonos
szymonos deleted the rfr/pwsh-profile-order branch July 23, 2026 07:15
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