Introduction
Normally, when NuGet displays a list of packages, the Id
column, i.e., the package name column is quite a conservative fixed width, and more often than not, at least one package name, if not all, is or are truncated. With the plethora of packages starting with the same prefixes, it is foreseeable that one day, in the output of some Get-Package, the visible parts of the package names are all the same!
Background
I know next to nothing about PowerShell output formatting, like whether the current Get-Package formatting is a NuGet or a PowerShell product. It doesn't really matter because I have found a solution to the problem with just PowerShell.
Using the Code
A basic knowing your way around Nuget's Package Manager Console (although it's more like everything's console) is assumed, but no extra technical knowledge required.
To show the full length of the Id
(package name) column, use this command:
Get-Package | ft -AutoSize
This pipes the output of Get-Package
, a PowerShell CmdLet written for Nuget, to ft
, an alias for the native Format-Table
cmdlet. This cmdlet lives up to its name and offers various table formatting features. The only function we should worry about for package names is the -AutoSize
option, which does what it says and tries to display the max of each column.
If you use options with Get-Package
, like -ProjectName
, you still use them as normal, just after the Get-Package
but before the pipe to Format-Table
.