Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Download a NuGet package using cmd

    Scheduled Pinned Locked Moved Support
    2 Posts 2 Posters 32 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      hashim.abu-gellban_3562
      last edited by

      I followed "https://docs.inedo.com/docs/proget-feeds-nuget" to download the package as follows:

      #https://«proget-server»/«feed-name»/«packageName»/«versionNumber[optional]»
      $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
      $headers.Add("X-ApiKey", "xyz")

      $response = Invoke-RestMethod 'https://ip:port/feedname/nuget-paclkage-name/version' -Method 'GET' -Headers $headers
      $response | ConvertTo-Json

      I got the error:
      Invoke-RestMethod :
      Not Found

      My question, how can I download a NuGet package as file (e.g., zip)?

      stevedennisS 1 Reply Last reply Reply Quote 0
      • stevedennisS Offline
        stevedennis inedo-engineer @hashim.abu-gellban_3562
        last edited by

        Hi @hashim-abu-gellban_3562,

        I see a few issues here...

        First, the URL you're using is not correct; the easiest way to to find the url by clicking the "download package link" in the ProGet UI. It will look like this: /nuget/your-feed-name/package/your-package-name/your-version-number

        Second, you're downloading a file - so you want to use a powershell command like this:

        $url = "https://myprogetserver/feeds/mynuggets/package/mypackage/1.0.0"
        $destination = "c:\mypackages\mypackage-1.0.0.zip"
        Invoke-WebRequest -Uri $url -OutFile $destination
        

        Best,
        Steve

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation