Format-Table

Use this cmdlet to format report output as a table that is displayed in the PowerShell console window, with the selected properties of the object in each column. The object type determines the default layout and properties that are displayed in each column, but you can use the Property parameter to select the properties that you want to display. You can specify any of the following parameters on the command line:

  • Zone
  • AD User
  • UNIX User Name
  • UID
  • Shell
  • Home Directory
  • Is Enabled
  • Primary Group
  • Is Orphan

For example, the following command displays the output of UsersReport.ps1 in a table. The -GroupBy option shown here specifies that separate tables are displayed for each zone. Each zone table contains columns for AD User, UNIX User Name, UID, Shell, Home Directory, Is Enabled, Primary Group, and Is Orphan.

. PS> ./UsersReport.ps1 | Format-Table "AD User", "UNIX User Name", "UID", "Shell", "Home Directory", "Is Enabled", "Primary Group", "Is Orphan" -GroupBy Zone

Depending on your site’s zone configuration, this command would result in output similar to the following:

Note:   If the results are too wide to display in PowerShell console default window size, you can change the PowerShell screen size, and enable some arguments (such as wrap, autosize, and so on) provided by this cmdlet.