Examples of using Format-table in English and their translations into German
{-}
-
Colloquial
-
Official
-
Ecclesiastic
-
Medicine
-
Financial
-
Ecclesiastic
-
Political
-
Computer
-
Programming
-
Official/political
-
Political
Format-Table returns format objects that represent the table.
The Format cmdlets are Format-Wide, Format-List, Format-Table, and Format-Custom.
The Format-Table cmdlet might still truncate data, but it will only do so at the end of the screen.
It uses a pipeline operator(_)to send the PSSessions to the Format-Table cmdlet alias.
Blg format-table timestamp The second and third commands save particular time stamps in the$start and$end variables.
We will only describe the Format-Wide, Format-List, and Format-Table cmdlets in this user's guide.
The Autosize parameter of Format-Table resizes the table columns so that they display properly in Windows PowerShell.
For example, piping objects representing the services on the computer to a Format-Table command.
The Format-Table command assumes that the nearer a property is to the beginning of the property list, the more important it is.
The name of the Property parameter is optional, so you can omit it"format-table name, dependentservices.
C:\PS> get-pssnapin format-table-auto This command formats information about Windows PowerShell snap-ins in a table.
You can alsouse the GroupBy parameter of the formatting cmdlets(such as Format-Table[m2] and Format-List[m2]) to group objects.
Get-item-path man format-table-wrap-autosize If you are in a different drive, add the drive name(Function:) to the path.
To find the InstanceID of the PSSessions in the current session, type"get-pssession format-table Name, ComputerName, InstanceId.
The Format-Table command uses the Property parameter to specify the properties displayed in the table, including the MachineName property.
You can also use thebuilt-in alternate views of the processes available with Format-Table, such as"StartTime" and"Priority".
If the Format-Table command cannot display all the properties, it will remove some columns from the display and provide a warning.
To display the objects, use the formatting cmdlets, such as Format-Table and Format-List, or pipe the objects to Out-GridView.
If you use the Format-Table cmdlet with no property names specified to format the output of the Get-Process command, you get exactly the same output as you do without performing any formatting.
Because DHCP-related properties for an adapter generally beginwith"DHCP," you can use the Property parameter of Format-Table to display only those properties.
Another pipeline sends the sorted data to the Format-Table cmdlet, where the data is formatted as a table with InstanceName and CookedValue columns.
Because Format-Wide only shows a single property, its Property parameter only takes a single value,but the property parameters of Format-List and Format-Table will accept a list of property names.
Wildcards work with property names in Format-Table, so the final pipeline element can be reduced to Format-Table-Property TotalV*, Free.
When objects are not formatted automatically, you can use the formatting cmdlets,such as Format-Table or Format-List, to format and display selected properties.
C:\PS> get-service format-table-property Name, DependentServices This command displays all of the services on the computer in a table with two columns, Name and DependentServices.
To allow the complete display of names for the occasional services with extremely long names,you may want to use Format-Table with the AutoSize and Wrap parameters, to optimize column width and allow long names to wrap instead of being truncated.
For example, piping objects representing the services on the computer to a Format-Table command, such as: get-service format-table-property name, dependentservices is much like saving the service objects in a variable and using the InputObject parameter of Format-Table to submit the service object.$services get-service format-table-inputobject $services -property name, dependentservices or imbedding the command in the parameter value format-table-inputobject (get-service wmi) -property name, dependentservices However, there is an important difference.
The command uses a pipeline operator to send the results to a Format-Table command, which displays only the Name and Permission properties of the configurations in a table.
If you specify the AutoSize parameter when you run the Format-Table command, Windows PowerShell will calculate column widths based on the actual data you are going to display.
EXAMPLE 4 C:\PS>$a get-process C:\PS> get-process-inputobject$a format-table-view priority Description These commands list the processes on the computer in groups based on their priority class.