Closed MaxFrost closed 1 year ago
Hi @alerickson,
Was there a fix implemented for this issue? I can't seem to find the PR that referenced a fix for this? 😞
I've been experiencing this exact error with GitLab v3 Nuget feed: https://docs.gitlab.com/ee/user/packages/nuget_repository/
Further details in https://github.com/PowerShell/PowerShellGet/issues/215#issuecomment-1227266276
Create deploy token (username: build-deploy-token
) with read_package_registry
, write_package_registry
permissions.
# Enter build-deploy-token as username and token secret as password
$Creds = Get-Credential
Register-PSResourceRepository -Name "GitLab" -Uri "https://gitlab.<domain>.com/api/v4/projects/<id>/packages/nuget/index.json" -Trusted -Verbose
# Name doesn't matter as it fails to load service index
Find-PSResource -Name "Test" -Repository "GitLab" -Credential $Creds -Verbose
# Output:
# PS > Find-PSResource -Repository "GitLab" -Credential $Creds -Verbose -Name test
# VERBOSE: Searching in repository GitLab
# VERBOSE: credential successfully set for repository: GitLab
# VERBOSE: Error retrieving resource from repository: Unable to load the service index for source https://gitlab.<domain>.com/api/v4/projects/<id>/packages/nuget/index.json.
@alerickson - can this please be reopened? The above example is still reproducing the problem.
If I register the same feed with v2,
https://pkgs.dev.azure.com/<teamname>/_packaging/<feedname>/nuget/v2
, I can use the sameFind-PSResource
call passing in $cred and it functionsUsing Powershell 7.0.0, PowerShellGet 3.0.0-beta1 $Cred is using a PAT token with full access to remove any doubt if it's an issue on the authentication side as the password.