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

Update all packages to specific Version from Specific Source #1760

Open
wolfpackt99 opened this issue Nov 24, 2015 · 9 comments
Open

Update all packages to specific Version from Specific Source #1760

wolfpackt99 opened this issue Nov 24, 2015 · 9 comments
Labels
help wanted Considered good issues for community contributions. Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Status:Excluded from icebox cleanup Status:Inactive Icebox issues not updated for a specific long time Type:Feature
Milestone

Comments

@wolfpackt99
Copy link

Need to be able to do the following from SOMEWHERE in the UI or other.
Package-Manager-Console
update-package -Version x.x.x.x -Source my-package-source -ProjectName Some.sln

This makes me have to put an Id in currently (single package). I want to update all packages from this source to this version - where installed. Would like to do this with solution closed to speed the process. Not Sure if .sln is valid for projectname.

Nuget.CommandLine
nuget update Some.sln -Source my-package-source -Version x.x.x.x

Currently doesn't support -Version. Updates all packages from given source but always is latest... also could change the number during the process if the feed is updated mid-process resulting in mis-matched version numbers.

Nuget Package Packages UI
Change a Source to desired Source. Filter to 'Installed'. Query to a version and hit an Update All button.

@yishaigalatzer
Copy link

Would like to do this with solution closed to speed the process. Not Sure if .sln is valid for projectname.

This just doesn't work, the project system is the thing that makes the changes to the project, nuget just calls into it. You will have to move to project.json based project, where at some point we will be able to support it.

nuget update Some.sln -Source my-package-source -Version x.x.x.x
See above, just doesn't really work for any other changes than a dll version change.

Nuget Package Packages UI
Even without the filter (which I don't think we are going to do), with sorting and multi selection, you are able to update-all

@yishaigalatzer yishaigalatzer added this to the Client-VNext milestone Nov 24, 2015
@yishaigalatzer
Copy link

You can probably achieve this today by writing a powershell script, starting by using the following cmdlet

get-package -updates -source yoursourcename

Will enumerate all the packages from the source you specified that have updates and from there you can change them to the right version.

@deepakaravindr might be able to help some more on this

@deepakaravindr
Copy link

@wolfpackt99,

Adding on @yishaigalatzer said, you can use `Get-Package -Updates -Source yoursource' to get the list of the updates available from the specified source on the packages installed on your project. And, do more using pipelining in powershell

For example, if you installed WindowsAzureStorage -Version 4.3.0 on a C# console net45 application,
and run the command with http://www.nuget.org/api/v2 as the source, you will get the results as in the following snapshot

image

From this result, you can pick all the packages which has updates in the source specified and the exact version by using a call like the following. In the same example, if I wanted to list all the packages in my project which has updates from the specifed source of http://www.nuget.org/api/v2 and there is an update with version as 5.7.0

image

Even better, upon getting the filtered result, You can call Update-Package on the package ids from the specified source. In the same example I have used, if you wanted to update all the installed packages to version 5.7.0 from the specified source if available, you may do the following

PM> Get-Package -Updates -Source http://www.nuget.org/api/v2 | ?{ $_.Version -eq '5.7.0' } | %{ Update-Package $_.Id -Version 5.7.0 -Source http://www.nuget.org/api/v2 }

Cropped snaphot of the results as follows

image

Please let me know if you need more information

@wolfpackt99
Copy link
Author

hey guys thanks for the updates. I just got VS2015 Update 1 and now the UI
has some upgraded features. You guys answered in regards to the Package
Manager Console, but does anyone have a solution for the command line. This
has always been faster. allowing to do so with solution closed.

-Trent

On Tue, Nov 24, 2015 at 6:50 PM, Deepak Aravindakshan <
notifications@github.com> wrote:

@wolfpackt99 https://github.com/wolfpackt99,

Adding on @yishaigalatzer https://github.com/yishaigalatzer said, you
can use `Get-Package -Updates -Source yoursource' to get the list of the
updates available from the specified source on the packages installed on
your project. And, do more using pipelining in powershell

For example, if you installed WindowsAzureStorage -Version 4.3.0 on a C#
console net45 application,
and run the command with http://www.nuget.org/api/v2 as the source, you
will get the results as in the following snapshot

[image: image]
https://cloud.githubusercontent.com/assets/2380340/11384016/ff0794fc-92c0-11e5-8b8a-504dba0847e3.png

From this result, you can pick all the packages which has updates in the
source specified and the exact version by using a call like the following.
In the same example, if I wanted to list all the packages in my project
which has updates from the specifed source of http://www.nuget.org/api/v2
and there is an update with version as 5.7.0

[image: image]
https://cloud.githubusercontent.com/assets/2380340/11384123/ff56fb0e-92c1-11e5-91b5-62827b581300.png

Even better, upon getting the filtered result, You can call Update-Package
on the package ids from the specified source. In the same example I have
used, if you wanted to update all the installed packages to version 5.7.0
from the specified source if available, you may do the following

PM> Get-Package -Updates -Source http://www.nuget.org/api/v2 | ?{
$.Version -eq '5.7.0' } | %{ Update-Package $.Id -Version 5.7.0 -Source
http://www.nuget.org/api/v2 }

Cropped snaphot of the results as follows

[image: image]
https://cloud.githubusercontent.com/assets/2380340/11384210/d8825b8a-92c2-11e5-8f62-02491892db4e.png

Please let me know if you need more information


Reply to this email directly or view it on GitHub
#1760 (comment).

@wolfpackt99
Copy link
Author

any update about the command line and supporting the -Version Tag.

@yishaigalatzer
Copy link

This is targeted at vNext which means it was triaged to be lower priority than about 200 other items we are trying to accomplish for 3.4 and the version immediately after that.

Like with anything else, we can take PR if you want to accelerate it

@yishaigalatzer yishaigalatzer added the help wanted Considered good issues for community contributions. label Jan 13, 2016
@casualblair
Copy link

I would like to attempt to PR this change but it will require a change to the Nuget.PackageManagement.NuGetPackageManager class and I cannot find the source for this anywhere but in the NugetArchive repos. Can someone point me in the right direction?

@yishaigalatzer
Copy link

Nuget.client repo

@harikmenon harikmenon modified the milestones: Client-VNext, Future Apr 19, 2016
@casualblair
Copy link

casualblair commented May 6, 2016

Pull requests created for code and documentation:
Code : NuGet/NuGet.Client#570
Documentation : NuGet/NuGetDocs#462

The change only supports specifying a version if a single package id has been provided.

This will be able to support the original feature request (update everything to specific version) through powershell piping. I don't believe an "Update everything to version X.Y.Z" command would be helpful if that version exists for multiple unrelated packages, so a single command that affects multiples via pipes should suffice.

@rrelyea rrelyea modified the milestones: Future-2, Backlog Feb 22, 2019
@ghost ghost added the Status:Inactive Icebox issues not updated for a specific long time label Sep 1, 2022
@jeffkl jeffkl added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Pipeline:Icebox labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Considered good issues for community contributions. Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Status:Excluded from icebox cleanup Status:Inactive Icebox issues not updated for a specific long time Type:Feature
Projects
None yet
Development

No branches or pull requests

9 participants