You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Register-PSRepository - Invalid SourceLocation path for PS repository hosted on Artifactory #86
Make sure you are able to repro it on the latest version
Search the existing issues.
Steps to reproduce
In version 2.2.6 Register-PSRepository adds unnecessary and invalid '/api/v2' at the end of SourceLocation when used with Artifactory hosted repository. My guess is that Artifactory returns 405 also for invalid repository paths.
The cause is a change in PowerShellGet’s URL validation:
Register-PSRepository probes the URL with /api/v2/ appended before trying the original.
Version 2.2.5 rejected HTTP 405 Method Not Allowed and falls back to the original URL.
Version 2.2.6 accepts 405, so it registers the incorrect appended URL.
Any workaround (other than downgrade to 2.2.5)?
Expected behavior
Name InstallationPolicy SourceLocation---- ------------------ --------------PSGallery Untrusted https://www.powershellgallery.com/api/v2Foo Trusted https://artifactory.foo.com/artifactory/api/nuget/Foo
Actual behavior
Name InstallationPolicy SourceLocation---- ------------------ --------------PSGallery Untrusted https://www.powershellgallery.com/api/v2Foo Trusted https://artifactory.foo.com/artifactory/api/nuget/Foo/api/v2/
Error details
Environment data
Name Value
---------
PSVersion 7.7.0
PSEdition Core
GitCommitId 7.7.0
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
changed the title [-]Invalid SourceLocation path for PS repository hosted on Artifactory[/-][+]Register-PSRepository - Invalid SourceLocation path for PS repository hosted on Artifactory[/+]on Nov 12, 2026
Activity
[-]Invalid SourceLocation path for PS repository hosted on Artifactory[/-][+]Register-PSRepository - Invalid SourceLocation path for PS repository hosted on Artifactory[/+]