azure-functions-powershell-worker icon indicating copy to clipboard operation
azure-functions-powershell-worker copied to clipboard

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

Open andystaples opened this issue 2 years ago • 0 comments

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.

andystaples avatar Aug 18 '23 17:08 andystaples