NuGet Version in Console

Mar 14, 2011 at 10:07 PM

How do you get the version in the powershell console?

Right now the only way I see to do it is to go up to Tools -> Extension Manager... and then click on NuGet Package Manager.  

Would be nice to have a command added to the powershell console that would allow me to know what version I am using.

NuGet --version 

Or something similar in a good powershell format?  Would anyone else find this useful?

Mar 14, 2011 at 10:08 PM

In the PowerShell Console, $host.version should do the trick.

Mar 14, 2011 at 10:19 PM
Ouch. It's off by one. is the reported installed.

Each package is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.

Type 'get-help NuGet' to see all available NuGet commands.

PM> $host.version

Major Minor Build Revision
----- ----- ----- --------
1 1 229 159

Would be nice to see that documented when I type Get-Help NuGet.
"Be passionate in all you do"
Mar 14, 2011 at 10:28 PM

The VSIX and the host are version separately, so it's possible they actually off by one. Including a note in get-help nuget on how to show the version isn't a bad idea. I'll create a work item.

Mar 14, 2011 at 10:29 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 14, 2011 at 10:30 PM

Better yet (or additionally): why not just display the version in the PS console when it is launched? It would be like most command line tool that start out by telling you why you're running.

Mar 14, 2011 at 10:31 PM

That shouldn't happen. We tie the version of the VSIX and the host together.

Mar 14, 2011 at 10:31 PM

Agreed. I updated the issue.

Mar 14, 2011 at 10:36 PM
I like the idea of notifying version on initialization as well.

Would like it in the Get-Help as well. Otherwise you would have to close and reopen to find version again (unless you knew the command). :D
Mar 14, 2011 at 10:38 PM

I added a note to the issue to display it in get-help nuget as well.

Mar 14, 2011 at 10:42 PM
You tha man!
Mar 14, 2011 at 10:44 PM
A switch in NuGet.exe would also be sweet.