Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget.exe download fails in GetPSBuild.ps1 #77

Open
folding opened this issue Mar 12, 2016 · 4 comments
Open

Nuget.exe download fails in GetPSBuild.ps1 #77

folding opened this issue Mar 12, 2016 · 4 comments

Comments

@folding
Copy link

folding commented Mar 12, 2016

Nuget.org throws a 401 unauthorized when I try to run GetPSBuild.ps1

Does the webclient need a user agent string?

PS C:> (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ligershark/psbuild/master/src/GetPSBuild.ps1") | iex
Get-Nuget : Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (401) Unauthorized."
At line:163 char:31

  •             $nugetPath = (Get-Nuget -toolsDir $toolsDir -nugetDownloadUrl $n ...
    
  •                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-Nuget], MethodInvocationException
    • FullyQualifiedErrorId : WebException,Get-Nuget

psbuild not found, and was not downloaded successfully. sorry.
Check your nuget.config (default path=C:\Users\jcarlson\AppData\Roaming\NuGet\NuGet.config) file to ensure that
nuget.org is enabled.
You can also try changing the versionToInstall value.
You can file an issue at https://github.com/ligershark/psbuild/issues.
At line:177 char:13

  •         throw ("psbuild not found, and was not downloaded successfully. sorr ...
    
  • - CategoryInfo          : OperationStopped: (psbuild not fou...psbuild/issues.:String) [], RuntimeException
    - FullyQualifiedErrorId : psbuild not found, and was not downloaded successfully. sorry.
      Check your nuget.config (default path=C:\Users\jcarlson\AppData\Roaming\NuGet\NuGet.config) file to ensure that nuget.org is enabled.
      You can also try changing the versionToInstall value.
      You can file an issue at https://github.com/ligershark/psbuild/issues.
    
@sayedihashimi
Copy link
Member

Its working for me both locally, as well as in CI. My CI builds for other projects call this on each build. Any idea how I can reproduce this? What happens if you paste http://nuget.org/nuget.exe into a browser window? Does the file get downloaded?

@sayedihashimi
Copy link
Member

As a workaround until we can figure out what's happening, you can download the psbuild nuget pug and call Import-Module psbuild.psd1. The file is in the tools folder.

@folding
Copy link
Author

folding commented Mar 12, 2016

I ended up downloading nuget.exe from the browser like you said and placing it in the tools folder and then re-running the script which then completed the install. And I'm chalking it up to an issue with the firewall or network filter at my work because it worked from home on the first try. If I ever reproduce it I'll open another issue. Thanks for the tool and quick response.

@folding folding closed this as completed Mar 12, 2016
@sayedihashimi
Copy link
Member

@folding lets keep this open, I would like to fix the underlying issue when I have time. I think that I'll need to upgrade to using NuGet v3 client. When I do that I'd like to see if I can fix this. Reopening, when I make changes I'll update this issue. It may be a while before I do that though.

@sayedihashimi sayedihashimi reopened this Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants