The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,783 other followers

PowerShell: Format-Table to show all columns/members

Posted by jpluimers on 2019/07/18

I’m not even sure if I’ve posted this before, but I always forget how to show all members (or columns) using Format-Table.

It’s dead easy: -Property *

Get-ChildItem | Format-Table -Property *

Later I found out this is equivalent with the shorter version where you omit the -Property part which I wrote about in [WayBackPowerShell: when Format-Table -AutoSize displays only 10 columns and uses the width of the console when redirecting to file.

So you can shorten the above to:

Get-ChildItem | Format-Table *

It has way more columns than this:

Get-ChildItem | Format-Table

The extra members in both marked with *:

  • PSPath
  • PSParentPath
  • PSChildName
  • PSDrive
  • PSProvider
  • PSIsContainer
  • BaseName
  • Mode *
  • Name *
  • FullName
  • Parent
  • Exists
  • Root
  • Extension
  • CreationTime
  • CreationTimeUtc
  • LastAccessTime
  • LastAccessTimeUtc
  • LastWriteTime *
  • LastWriteTimeUtc
  • Attributes

The odd thing: one property fails in the -Property * table:

  • Length

I tracked this down to how -Property * works: it takes the first entry in the list. If that is not a file, then it has no Length property: [WayBackpowershell – Measure-Object : The property “length” cannot be found in the input for any objects – Stack Overflow.

Note that for a GUI version, you can replace Format-Table with Out-GridView. See

-jeroen.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: