Home > Powershell > Powershell: Output only values

Powershell: Output only values

If you want to hide the columns headings in Powershell output you can use the “-hidetableheaders” parameter.


Get-QADGroup sales | select samaccountname | ft -hidetableheaders

But white spaces remains when you use this parameter and it might be not  useful when you want to export these values to a text file. You can solve this with the “foreach” loop:

Get-QADGroup sales |  foreach { $_.samaccountname }

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: