user1869558
user1869558

Reputation: 705

How to fix "invalid Web Uri" for Powershell Register-PSRepository?

A few weeks ago this error started popping up.

Set-PSRepository : The specified Uri 'http://*****' for parameter     
'SourceLocation' is an invalid Web Uri. 
Please ensure that it meets the Web Uri requirements.

I'm not sure how to fix this short of uninstalling Powershell. There is a workaround available on StackOverflow but it's clunky and will not work for me long term.

Frankly I'd rather just find where the PSRepositories are stored and edit the files manually when I need to.

Upvotes: 1

Views: 13170

Answers (2)

Sebastian
Sebastian

Reputation: 1

Had the same issue, for me it was an expired certificate at my own repostitory. Exchanged the certificate and the error was gone.

Upvotes: 0

Rodolfo Grave
Rodolfo Grave

Reputation: 1328

The answer to this other question should help: Invalid Web Uri error on Register-PSRepository

It involves registering the repository using a local path first, then updating it to point to the URL.

Upvotes: 1

Related Questions