Skip to content

Nuget.exe download fails in GetPSBuild.ps1 #77

@folding

Description

@folding

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.
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions