Search code examples
powershellrepositoryoneget

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.


Solution

  • 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.