Azure / Azure/azure-functions-powershell-worker

Managed Dependencies: Insufficiently specific error message when Save-Module is unable to access PS Gallery

Open
#981 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
215
Forks
61
Avg merge
21h 4m
Merged PRs (30d)
6

Description

Per this issue: https://portal.microsofticm.com/imp/v3/incidents/details/413931391/home
When customer configuration prevents Save-Module from accessing the PowerShell Gallery, the error message is generated:
Failed to install module {module} version {version}. 1st attempt. Error: 'The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to find repository 'PSGallery'. Use Get-PSRepository to see all available repositories.'

This error message comes from the following line in PowerShellGet repo: https://github.com/PowerShell/PowerShellGetv2/blob/3b38eec8742d6b6f26cf0f010e0dd95691ed5ade/src/PowerShellGet/PSGet.Resource.psd1#L174
This is not helpful when diagnosing the cause of the error. Filing this issue for discussion on how we can improve this behavior.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the linked PowerShellGet resource file at src/PowerShellGet/PSGet.Resource.psd1 around line 174 and reviewing how Save-Module reports failure to access PSGallery. Use the reported customer configuration and Get-PSRepository context to understand the failure. Done means an agreed, more diagnostically useful error message and corresponding validated behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.