Home > Powershell > Powershell: Display the complete content of a value

Powershell: Display the complete content of a value

When you output object attributes that have long value names then you might not view the complete name of the value into the Shell console. I use the following command for an example:

Get-QADUser test_user | select samaccountname, UserPrincipalName, ModificationDate, CanonicalName

You can see that CanonicalName is not displayed completely. The best solution is to use the “format-table -autosize” in combination with a “out-string” with a high string width:

Get-QADUser test_user | select samaccountname, UserPrincipalName, ModificationDate, CanonicalName | Format-Table -AutoSize | Out-String -Width 2000  > test.txt

Just use a high string width, the “format-table -autosize” will trim the column size to a size that is sufficient for the values, then you have always the complete value with a neat column width.

Advertisements
Categories: Powershell
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: