Closed hbuckle closed 1 year ago
Thanks @hbuckle look at this blog post for more information on how to use credentials with PowerShellGet 3 https://devblogs.microsoft.com/powershell/powershellget-3-0-preview-14/ we need to better document this scenario
@SydneyhSmith - I should still be able to pass credentials on the command line though? It was working fine in beta19.
Yes you should, we will investigate this
Hello, @SydneyhSmith I'm running into the same problem. I'm getting the 404 error when using Find-PSResource
and Install-PSResource
when the module and version exist in the repository. This is working with beta19, but not beta20 or beta21.
Using Fiddler to intercept the HTTPS requests, I believe to have figured out why. The server is indeed returning a 404, because the request URL is formatted incorrectly.
Here is an example: https://github.com/PowerShell/PowerShellGet/blob/f41ee9c9583ba26b982008d943a54eb73d4a68da/src/code/V3ServerAPICalls.cs#LL922C47-L922C47
// https://api.nuget.org/v3/registration5-gz-semver2/newtonsoft.json/13.0.2.json
var requestPkgMapping = $"{registrationsBaseUrl}{packageName.ToLower()}/{version}.json";
Even from the comment above it, there should be a /
between {registrationsBaseUrl}
and {packageName.ToLower()}
. The request before the one that fails (GET /[feed]/v3/index.json
) is returning URLs that do not end in /
. Can anyone confirm if the server needs to end these URLs with /
or if this is a bug in PowerShellGet beta20? I'm guessing a bug since this works in beta19.
EDIT: From this documentation it seems like there should be a /
between id (registrationsBaseUrl) and LOWER_ID (packageName).
GET {@id}/{LOWER_ID}/index.json
https://learn.microsoft.com/en-us/nuget/api/package-base-address-resource
Out of interest how did you get it going through Fiddler? I thought proxies weren't supported yet?
Out of interest how did you get it going through Fiddler? I thought proxies weren't supported yet?
Nothing special outside configuring Fiddler to capture and decrypt HTTPS traffic. The Fiddler CA needs trusted on the system and you need to make sure tls1.2 is in the list of protocols Fiddler uses.
@SydneyhSmith @alerickson - looks like an easy fix, can it go in the next beta? I can't test anything above 3.0.19 because they doesn't work with Azure Devops
@hbuckle we made a bunch of fixes for ADO feeds and added more tests so for the next release so I am hoping this is resolved...adding @anamnavi as she did most of that work and may be able to test
This should be resolved with PR #1167
Prerequisites
Steps to reproduce
Expected behavior
Actual behavior
Error details
Environment data
Visuals
No response