Open varunmankal opened 3 years ago
The Register-PSRepository
cmdlet is part of the PowerShellGet module and isn't managed in this repo. This bug should be reported to https://github.com/PowerShell/PowerShellGetv2.
While the message is misleading, this error can also be shown if the URI is not reachable as per this check. I recommend you try out this code to see what happens
# Change to your actual `-Source` value
$endpoint = 'https://internal.server/api/nuget/mods'
$handler = [Net.Http.HttpClientHandler]::new()
$handler.UseDefaultCredentials = $true
$httpClient = [Net.Http.HttpClient]::new($handler)
$response = $httpClient.GetAsync($endpoint)
"{0:d} {0}" -f $response.Result.StatusCode
There's a good chance this is due to either an unreachable host or potentially certificate validation problems.
GitHubPowerShellGet is the Package Manager for PowerShell - PowerShell/PowerShellGetv2
In addition to @jborean93: use Nuget explorer NUGet explorer or equivalent RHEL GUI tool to validate your nuget source.
Also, check if NuGet is present as a provider in PowerShell https://docs.microsoft.com/en-us/powershell/module/packagemanagement/get-packageprovider?view=powershell-7.1
The Get-PackageProvider cmdlet returns a list of package providers that are connected to Package Management. Examples of these providers include PSModule, NuGet, and Chocolatey. You can filter the results based on all or part of one or more provider names.
Ran the following commands in RHEL 7
Steps to reproduce
Expected behavior
Actual behavior
Environment data