The Format-Table cmdlet formats the output of a command as a table with the selected properties of the objects in each column. It is especially useful for displaying data from cmdlets like Get-WmiObject.

Basic Usage

1. Retrieve Data with Get-WmiObject:

PS C:\windows\system32> Get-WmiObject -Class Win32_Product

Example output:

IdentifyingNumber : {90140000-00D1-0409-1000-0000000FF1CE}
Name              : Microsoft Access database engine 2010 (English)
Vendor            : Microsoft Corporation
Version           : 14.0.7015.1000
Caption           : Microsoft Access database engine 2010 (English)

2. Format Output as a Table:

PS C:\windows\system32> Get-WmiObject -Class Win32_Product | Format-Table Name, Version -AutoSize

Example formatted output:

Name                                                Version
----                                                -------
Microsoft Access database engine 2010 (English)     14.0.7015.1000
Office 16 Click-to-Run Extensibility Component      16.0.12345.12345
Office 16 Click-to-Run Localization Component       16.0.12345.12345


1 Comment

Fred · 18 June 2024 at 19h01

Vous pourriez montrer comment on fait un format-custom ?
Merci

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

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