Open stuartluscombe opened 4 years ago
I've encountered the same issue when trying to publish a powershell module to an azure devops feed.
PS ~> Register-PSRepository -Name "PowershellFeed" -SourceLocation "https://pkgs.dev.azure.com/org/_packaging/PowershellFeed/nuget/v3" -PublishLocation "https://pkgs.dev.azure.com/org/_packaging/PowershellFeed/nuget/v3" -InstallationPolicy Trusted -Credential $credsAzureDevopsServices
Register-PSRepository : The specified Uri 'https://pkgs.dev.azure.com/org/_packaging/PowershellFeed/nuget/v3' for parameter 'SourceLocation' is an invalid Web Uri.
Please ensure that it meets the Web Uri requirements.
At line:1 char:1
+ Register-PSRepository -Name "PowershellFeed" -SourceLocation "https:/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (https://pkgs.de...llFeed/nuget/v3:String) [Register-PSRepository], ArgumentException
+ FullyQualifiedErrorId : InvalidWebUri,Register-PSRepository
PS ~> $error
Register-PSRepository : The specified Uri 'https://pkgs.dev.azure.com/org/_packaging/PowershellFeed/nuget/v3' for parameter 'SourceLocation' is an invalid Web Uri.
Please ensure that it meets the Web Uri requirements.
At line:1 char:1
+ Register-PSRepository -Name "PowershellFeed" -SourceLocation "https:/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (https://pkgs.de...llFeed/nuget/v3:String) [Register-PSRepository], ArgumentException
+ FullyQualifiedErrorId : InvalidWebUri,Register-PSRepository
Register-PSRepository : The specified Uri 'https://pkgs.dev.azure.com/org/_packaging/PowershellFeed/nuget/v3' for parameter 'SourceLocation' is an invalid Web Uri.
Please ensure that it meets the Web Uri requirements.
At line:1 char:1
+ Register-PSRepository -Name "PowershellFeed" -SourceLocation "https:/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (https://pkgs.de...llFeed/nuget/v3:String) [Register-PSRepository], ArgumentException
+ FullyQualifiedErrorId : InvalidWebUri,Register-PSRepository
Unable to find type [System.Net.Http.HttpClient].
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:6260 char:9
+ [System.Net.Http.HttpClient]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Http.HttpClient:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
Get-Variable : Cannot find a variable with the name 'PackageManagementProvider'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4079 char:16
+ ... if(Get-Variable -Name PackageManagementProvider -ErrorAction ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (PackageManagementProvider:String) [Get-Variable], ItemNotFoundException
+ FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.GetVariableCommand
Unable to find type [Microsoft.PowerShell.Commands.PowerShellGet.Telemetry].
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:715 char:26
+ ... yMethods = ([Microsoft.PowerShell.Commands.PowerShellGet.Telemetry] | ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power...llGet.Telemetry:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
@stuartluscombe did you ever find a solution to this?
PackageManagement: 1.4.6 PowerShellGet: 2.2.3 PowerShell: 5.1
When trying to register an Azure DevOps artifact feed as a PowerShell repository as per the guide at https://docs.microsoft.com/en-us/azure/devops/artifacts/tutorials/private-powershell-library?view=azure-devops I keep getting errors during the registration.
Steps to reproduce:
Publish a PowerShell module to an Azure Artifact feed Create a PAT with READ access only Create a PSCredential object with your Azure DevOps e-mail and the PAT as username/password. Try to register the feed using an elevated terminal