27

I'm trying to get an output from a powershell command. However The output is truncated.

[PS] >Get-QADGroup "admins"

Name                           Type            DN
----                           ----            --
Admins                         group CN=Admins,OU=Profiles,OU=Groups,OU=Sw...

How do I tell this shell wannabe not to truncate its data?

SamK
  • 2,094
  • 3
  • 17
  • 18
  • 2
    add format pipes like Format-Wide or Format-List , http://technet.microsoft.com/en-us/library/dd347677.aspx – Iman Feb 08 '14 at 07:54

3 Answers3

45
Get-QADGroup "admins" | Ft -autosize -wrap

If space console is to small try:

Get-QADGroup "admins" | Fl name,type,dn

edit:

Get-QADGroup "admins" | Ft -autosize | out-string -width 4096 
CB.
  • 58,865
  • 9
  • 159
  • 159
  • 1
    Is there a way to get no wrap at all? – SamK Aug 23 '11 at 09:11
  • 1
    Just -autosize isn't enougth? -wrap reduce unused space between column. – CB. Aug 23 '11 at 09:25
  • 2
    try this: Get-QADGroup "admins" | Ft -autosize | out-string -width 4096 . I use this when I need an out-clipboard or out-file. – CB. Aug 23 '11 at 09:49
  • 2
    Works great with `| Ft -autosize | out-string -width 4096`. – SamK Aug 23 '11 at 09:53
  • Stop thinking in strings! Use the objects Luke. – JasonMArcher Aug 23 '11 at 19:50
  • @JasonMArcher I know this is an old post but can you show your possible answer using Objects? I'm just starting to learn and I think this can be useful for the future. – sam yi Apr 07 '16 at 15:27
  • 2
    Still can't believe this is the default behavior of POSH. Really sucks – Kellen Stuart Apr 18 '17 at 22:40
  • `Format-Table` has to parse the entire output before showing anything. Is there something that will output objects immediately wrapping without truncating? Especially if I've selected only one property. – silicontrip Sep 21 '21 at 01:41
4

This will prevent all output result truncating -

  • Run this and first to view the default enumeration limit.
    $FormatEnumerationLimit

  • Set the above to -1 to avoid truncating $FormatEnumerationLimit=-1

Satyajit Paul
  • 173
  • 1
  • 2
-1

I had the same issue - I increased the buffer size and window size of the powershell window I was running the commands in. It did not truncate in the powershell window nor the output file.

Chuck
  • 1