locked
How do I increase the column width in Powershell to avoid truncation? RRS feed

  • Question

  • When I run this command, my IPV6 address is truncated, I cannot determine how the bleep I get Powershell to not truncate the data =>

     

    PS C:\> get-clusterresource IP1 | get-clusterparameter Address
    
    Object                        Name                          Value                         Type
    ------                        ----                          -----                         ----
    IP1                           Address                       <strong>2001:4898:e0:3132:bdc:aaa8...</strong> String
    
    

    Thanks!


    Matt
    Tuesday, October 25, 2011 12:11 AM

Answers

  • Bloody ... I found it two seconds after I posted, figures!

    PS C:\> get-clusterresource IP1 | get-clusterparameter Address | Format-Table -Wrap -AutoSize

    Object Name    Value                                Type
    ------ ----    -----                                ----
    IP1    Address 2001:4898:e0:3132:bdc:aaa8:8bbd:b6c2 String


    Matt
    Tuesday, October 25, 2011 12:13 AM

All replies

  • Bloody ... I found it two seconds after I posted, figures!

    PS C:\> get-clusterresource IP1 | get-clusterparameter Address | Format-Table -Wrap -AutoSize

    Object Name    Value                                Type
    ------ ----    -----                                ----
    IP1    Address 2001:4898:e0:3132:bdc:aaa8:8bbd:b6c2 String


    Matt
    Tuesday, October 25, 2011 12:13 AM
  • Hey, thanks for posting. This was the top result in google and got me exactly what I was looking for.
    Wednesday, June 13, 2018 2:31 AM
  • There are several ways, so that maybe powershell can go through the whole list and figure out the max width needed:

    | ft -autosize

    | fl

    | more

    $a = command; $a

    Make a custom object (PSTypeName = 'MyObject') and format.ps1xml file for it. 

    Make the window wider

    Usually the widest column is put at the end.


    • Edited by JS2010 Thursday, June 14, 2018 12:06 AM
    Wednesday, June 13, 2018 12:27 PM
  • I found this command helpful as well.

    $FormatEnumerationLimit = -1


    Beware the Backstab!

    Thursday, April 25, 2019 12:51 AM