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

11.4k Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

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