-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Description
Description
Install-Module with -Repository PSGallery intermittently fails on windows-2025 runners because the PSGallery repository is not registered:
Get-PackageSource: Unable to find repository 'PSGallery'. Use Get-PSRepository to see all available repositories.
This is transient — re-running the same workflow on a different runner succeeds. The PSGallery repository should be pre-registered on all Windows runner images, but occasionally a provisioned runner is missing it.
Workaround: Re-register PSGallery before use:
if (-not (Get-PSRepository -Name PSGallery -ErrorAction SilentlyContinue)) {
Register-PSRepository -Default
}
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -ForcePlatforms affected
- GitHub Actions - Standard Runners
Runner images affected
- Windows Server 2025
Image version and build link
- Image:
windows-2025 - Version:
20260225.38.2 - Failed job: https://github.com/microsoft/windows-drivers-rs/actions/runs/22659747111/job/65677070595?pr=621
Is it regression?
Unknown — this is an intermittent/transient failure. It does not reproduce on every run, only on certain provisioned runners.
Expected behavior
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force succeeds because PSGallery is pre-registered on the runner image.
Actual behavior
The command fails with:
Get-PackageSource: Unable to find repository 'PSGallery'. Use Get-PSRepository to see all available repositories.
Process completed with exit code 1.
Repro steps
- Create a GitHub Actions workflow targeting
runs-on: windows-2025 - Add a step:
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force - Run the workflow repeatedly — eventually a runner will be provisioned without PSGallery registered
Reactions are currently unavailable