The Install PowerShell modules step in .github/workflows/copilot-setup-steps.yml installs modules with -Scope AllUsers, which targets /usr/local/share/powershell/Modules and requires root. The Copilot cloud coding-agent runner executes setup steps unelevated, so PowerShell-Yaml fails:
Administrator rights are required to install modules in '/usr/local/share/powershell/Modules'
Run: https://github.com/microsoft/hve-core/actions/runs/28358970351/job/84008736477
The retry/backoff added in #2134 does not help — it targets transient PSGallery outages, but this is a fixed permissions error, so all 3 attempts fail identically.
Root cause
PR #2134 intentionally kept copilot-setup-steps.yml calling Install-PSModules.ps1 directly with -Scope AllUsers (bypassing the composite action, whose cache restores only to the CurrentUser path). That assumed an elevated runner; the coding-agent runner is not elevated.
Fix
Switch the call to -Scope CurrentUser, which installs to ~/.local/share/powershell/Modules (no admin needed) and is on the same runner user PSModulePath the agent reads. Update .github/copilot-instructions.md to document the rationale.
Acceptance
- copilot-setup-steps workflow completes the module install step on the cloud agent
- No AllUsers/admin-rights errors
The
Install PowerShell modulesstep in.github/workflows/copilot-setup-steps.ymlinstalls modules with-Scope AllUsers, which targets/usr/local/share/powershell/Modulesand requires root. The Copilot cloud coding-agent runner executes setup steps unelevated, soPowerShell-Yamlfails:Run: https://github.com/microsoft/hve-core/actions/runs/28358970351/job/84008736477
The retry/backoff added in #2134 does not help — it targets transient PSGallery outages, but this is a fixed permissions error, so all 3 attempts fail identically.
Root cause
PR #2134 intentionally kept
copilot-setup-steps.ymlcallingInstall-PSModules.ps1directly with-Scope AllUsers(bypassing the composite action, whose cache restores only to the CurrentUser path). That assumed an elevated runner; the coding-agent runner is not elevated.Fix
Switch the call to
-Scope CurrentUser, which installs to~/.local/share/powershell/Modules(no admin needed) and is on the same runner user PSModulePath the agent reads. Update.github/copilot-instructions.mdto document the rationale.Acceptance