locked
register-psrepository for parameter 'SourceLocation' is an invalid Web Uri. Please ensure that it meets the Web Uri requirements. RRS feed

  • Question

  • Hi All,

    I created an Visual Studio Team Services (Online) repostitory and trying to load it in Powershell. However on registring the reposititory it keeps comming up with invalid Web Uri. Im not sure if I set up the repository correct and also unsure how to validate if its correct.

    Created the repository and the project is Git based.
    Created alternate credentials 

    register-PSRepository -Name 'ALL-Automation' -SourceLocation 'https://<URL>/_git/all-automation'  -Credential $Credentials -InstallationPolicy Trusted

    If somebody can point me in the right direction it would be great,

    The Idea is to have one script resource in TFS that can be loaded in azure automation as wel as on hybrid workers.

    Bin searching for a while now but not really able to find the right awnsers.

    Any help is appreciated


    Tuesday, April 24, 2018 9:09 AM

All replies

  • try

     Import-Module PowerShellGet
      $uri = 'https://<URL>/_git/all-automation' 
      $repo = @{ Name = 'MyRepository' 
       SourceLocation = $uri
       PublishLocation = $uri 
       InstallationPolicy = 'Trusted' 
    
       } 
       Register-PSRepository @repo -Credential $Credentials

    Tuesday, April 24, 2018 9:27 AM
  • Thank you for your reply Jiten, Still getting the same error. Does this work for you? That might indicate my repository is incorrect.
    Tuesday, April 24, 2018 9:45 AM