Skip to content

Commit 9c85e2c

Browse files
Merge pull request #12628 from MicrosoftDocs/main
Auto Publish – main to live - 2026-01-02 23:00 UTC
2 parents 56e2adb + 0a55ed6 commit 9c85e2c

File tree

25 files changed

+322
-208
lines changed

25 files changed

+322
-208
lines changed

reference/5.1/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md

Lines changed: 56 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: The `Format.ps1xml` files in PowerShell define the default display of objects in the PowerShell console. You can create your own `Format.ps1xml` files to change the display of objects or to define default displays for new object types that you create in PowerShell.
33
Locale: en-US
4-
ms.date: 04/25/2022
4+
ms.date: 12/26/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_format.ps1xml?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Format.ps1xml
@@ -88,7 +88,7 @@ headers, and the properties that are displayed in the body of the view. The
8888
format in `Format.ps1xml` files is applied just before the data is presented to
8989
the user.
9090

91-
## CREATING NEW FORMAT.PS1XML FILES
91+
## Creating new Format.ps1xml files
9292

9393
The `.ps1xml` files that are installed with PowerShell are digitally signed to
9494
prevent tampering because the formatting can include script blocks. To change
@@ -98,9 +98,7 @@ session.
9898

9999
To create a new file, copy an existing `Format.ps1xml` file. The new file can
100100
have any name, but it must have a `.ps1xml` file name extension. You can place
101-
the new file in any directory that is accessible to PowerShell, but it's useful
102-
to place the files in the PowerShell installation directory (`$PSHOME`) or in a
103-
subdirectory of the installation directory.
101+
the new file in any directory that is accessible to PowerShell.
104102

105103
To change the formatting of a current view, locate the view in the formatting
106104
file, and then use the tags to change the view. To create a view for a new
@@ -127,12 +125,11 @@ view of the culture objects. The following `Select-String` command finds the
127125
file:
128126

129127
```powershell
130-
$Parms = @{
131-
Path = "$PSHOME\*Format.ps1xml"
132-
Pattern = "System.Globalization.CultureInfo"
128+
$selectParams = @{
129+
Path = "$PSHOME\*Format.ps1xml"
130+
Pattern = 'System.Globalization.CultureInfo'
133131
}
134-
135-
Select-String @Parms
132+
Select-String @selectParams
136133
```
137134

138135
```Output
@@ -142,14 +139,20 @@ C:\Windows\System32\WindowsPowerShell\v1.0\DotNetTypes.format.ps1xml:115:
142139
<TypeName>System.Globalization.CultureInfo</TypeName>
143140
```
144141

145-
This command reveals that the definition is in the `DotNetTypes.Format.ps1xml`
142+
This command reveals that the definition is in the `DotNetTypes.format.ps1xml`
146143
file.
147144

148-
The next command copies the file contents to a new file,
149-
`MyDotNetTypes.Format.ps1xml`.
145+
The following commands copy the file contents to a new file named
146+
`MyDotNetTypes.Format.ps1xml` in a newly created `$HOME\Format` directory.
150147

151148
```powershell
152-
Copy-Item $PSHOME\DotNetTypes.format.ps1xml MyDotNetTypes.Format.ps1xml
149+
New-Item -Path $HOME\Format -ItemType Directory -Force
150+
151+
$copyParams = @{
152+
LiteralPath = "$PSHOME\DotNetTypes.format.ps1xml"
153+
Destination = "$HOME\Format\MyDotNetTypes.Format.ps1xml"
154+
}
155+
Copy-Item @copyParams
153156
```
154157

155158
Open the `MyDotNetTypes.Format.ps1xml` file in any XML or text editor, such as
@@ -289,10 +292,10 @@ the current PowerShell session.
289292

290293
This example uses the **PrependPath** parameter to place the new file in a
291294
higher precedence order than the original file. For more information, see
292-
[Update-FormatData](xref:Microsoft.PowerShell.Utility.Update-FormatData).
295+
[Update-FormatData][03].
293296

294297
```powershell
295-
Update-FormatData -PrependPath $HOME\Format\CultureInfo.Format.ps1xml
298+
Update-FormatData -PrependPath $HOME\Format\MyDotNetTypes.Format.ps1xml
296299
```
297300

298301
To test the change, type `Get-Culture` and review the output that includes the
@@ -310,8 +313,8 @@ LCID Name Calendar DisplayName
310313

311314
## The XML in Format.ps1xml files
312315

313-
The full schema definition can be found in [Format.xsd](https://github.com/PowerShell/PowerShell/blob/master/src/Schemas/Format.xsd)
314-
in the PowerShell source code repository on GitHub.
316+
The full schema definition can be found in [Format.xsd][04] in the PowerShell
317+
source code repository on GitHub.
315318

316319
The **ViewDefinitions** section of each `Format.ps1xml` file contains the
317320
`<View>` tags that define each view. A typical `<View>` tag includes the
@@ -376,13 +379,13 @@ that the `<ListControl>` tag is intended to display.
376379
### WideControl tag
377380

378381
The `<WideControl>` tag typically contains a `<WideEntries>` tag. The
379-
`<WideEntries>` tag contains one or more `<WideEntry>` tags. A `<WideEntry>` tag
380-
contains one `<WideItem>` tag.
382+
`<WideEntries>` tag contains one or more `<WideEntry>` tags. A `<WideEntry>`
383+
tag contains one `<WideItem>` tag.
381384

382385
A `<WideItem>` tag must include either a `<PropertyName>` tag or a
383-
`<ScriptBlock>` tag. A `<PropertyName>` tag specifies the property to display at
384-
the specified location in the view. A `<ScriptBlock>` tag specifies a script to
385-
evaluate and display at the specified location in the view.
386+
`<ScriptBlock>` tag. A `<PropertyName>` tag specifies the property to display
387+
at the specified location in the view. A `<ScriptBlock>` tag specifies a script
388+
to evaluate and display at the specified location in the view.
386389

387390
A `<WideItem>` tag can contain a `<FormatString>` tag that specifies how to
388391
display the property.
@@ -396,7 +399,7 @@ multiple `<CustomEntry>` tags. Each `<CustomEntry>` tag contains a
396399
formatting of the specified location in the view, including `<Text>`,
397400
`<Indentation>`, `<ExpressionBinding>`, and `<NewLine>` tags.
398401

399-
## DEFAULT DISPLAYS IN TYPES.PS1XML
402+
## Default displays in Types.ps1xml
400403

401404
The default displays of some basic object types are defined in the
402405
`Types.ps1xml` file in the `$PSHOME` directory. The nodes are named
@@ -417,15 +420,12 @@ value of the **Name** parameter:
417420
- FormatFileLoading
418421
- FormatViewBinding
419422

420-
For more information, see
421-
[Trace-Command](xref:Microsoft.PowerShell.Utility.Trace-Command) and
422-
[Get-TraceSource](xref:Microsoft.PowerShell.Utility.Get-TraceSource).
423+
For more information, see [Trace-Command][05] and [Get-TraceSource][06].
423424

424425
## Signing a Format.ps1xml file
425426

426427
To protect the users of your `Format.ps1xml` file, sign the file using a
427-
digital signature. For more information, see
428-
[about_Signing](about_Signing.md).
428+
digital signature. For more information, see [about_Signing][07].
429429

430430
## Sample XML for a Format-Table custom view
431431

@@ -434,25 +434,38 @@ The following sample creates a `Format-Table` custom view for the
434434
`Get-ChildItem`. The custom view is named **MyGciView** and adds the
435435
**CreationTime** column to the table.
436436

437+
Use `Select-String` to identify which `Format.ps1xml` file contains data for
438+
the type you're looking for.
439+
437440
The custom view is created from an edited version of the
438441
`FileSystem.Format.ps1xml` file that's stored in `$PSHOME` on PowerShell 5.1.
439442

440-
After your custom `.ps1xml` file is saved, use `Update-FormatData` to include
441-
the view in a PowerShell session. For this example, the custom view must use
442-
the table format, otherwise, `Format-Table` fails.
443+
After the custom `.ps1xml` file is saved, use the `Update-FormatData` cmdlet to
444+
include the view in the current PowerShell session. Or, add the update command
445+
to your PowerShell profile if you need the view available in all PowerShell
446+
sessions.
447+
448+
For this example, the custom view must use the table format, otherwise,
449+
`Format-Table` fails.
443450

444451
Use `Format-Table` with the **View** parameter to specify the custom view's
445-
name and format the table's output. For an example of how the command is run,
446-
see [Format-Table](xref:Microsoft.PowerShell.Utility.Format-Table).
452+
name, **MyGciView**, and format the table's output with the **CreationTime**
453+
column. For an example of how the command is run, see [Format-Table][08].
447454

448455
```powershell
449-
$Parms = @{
450-
Path = "$PSHOME\*Format.ps1xml"
451-
Pattern = "System.IO.DirectoryInfo"
456+
$selectParams = @{
457+
Path = "$PSHOME\*format.ps1xml"
458+
Pattern = 'System.IO.DirectoryInfo'
452459
}
453-
Select-String @Parms
454-
Copy-Item $PSHOME\FileSystem.format.ps1xml .\MyFileSystem.Format.ps1xml
455-
Update-FormatData -PrependPath $PSHOME\Format\MyFileSystem.Format.ps1xml
460+
Select-String @selectParams
461+
462+
$copyParams = @{
463+
LiteralPath = "$PSHOME\FileSystem.format.ps1xml"
464+
Destination = "$HOME\Format\MyFileSystem.Format.ps1xml"
465+
}
466+
Copy-Item @copyParams
467+
468+
Update-FormatData -PrependPath $HOME\Format\MyFileSystem.Format.ps1xml
456469
```
457470

458471
> [!NOTE]
@@ -582,9 +595,10 @@ Update-FormatData -PrependPath $PSHOME\Format\MyFileSystem.Format.ps1xml
582595
[01]: xref:Microsoft.PowerShell.Utility.Get-FormatData
583596
[02]: xref:Microsoft.PowerShell.Utility.Export-FormatData
584597
[03]: xref:Microsoft.PowerShell.Utility.Update-FormatData
585-
598+
[04]: https://github.com/PowerShell/PowerShell/blob/master/src/Schemas/Format.xsd
586599
[05]: xref:Microsoft.PowerShell.Utility.Trace-Command
587600
[06]: xref:Microsoft.PowerShell.Utility.Get-TraceSource
588-
601+
[07]: about_Signing.md
602+
[08]: xref:Microsoft.PowerShell.Utility.Format-Table
589603
[09]: /powershell/scripting/developer/format/format-schema-xml-reference
590604
[10]: /powershell/scripting/developer/format/writing-a-powershell-formatting-file

reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Utility
5-
ms.date: 11/18/2025
5+
ms.date: 12/27/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: ConvertFrom-Csv
99
---
1010
# ConvertFrom-Csv
1111

1212
## SYNOPSIS
13+
1314
Converts object properties in character-separated value (CSV) format into CSV versions of the
1415
original objects.
1516

@@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services`
145146

146147
When the **UseCulture** parameter is used, be sure that the current culture's default list
147148
separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't
148-
generate objects from the CSV strings.
149+
can't parse each column into distinct properties.
149150

150151
### Example 5: Convert CSV data in W3C Extended Log Format
151152

@@ -176,12 +177,17 @@ time cs-method cs-uri
176177

177178
### -Delimiter
178179

179-
Specifies the delimiter that separates the property values in the CSV strings. The default is a
180-
comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in
181-
single quotation marks.
180+
Specifies the delimiter that separates the property values in the CSV data. The default is a comma
181+
(`,`).
182+
183+
Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single
184+
quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double
185+
quotation marks.
182186

183-
If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv`
184-
can't create the objects from the CSV strings and returns the CSV strings.
187+
If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv`
188+
can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject**
189+
per row, each containing a single property whose name is the full header and whose value is the row
190+
text.
185191

186192
```yaml
187193
Type: System.Char

reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Utility
5-
ms.date: 03/14/2023
5+
ms.date: 12/27/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: ConvertTo-Csv
@@ -11,6 +11,7 @@ title: ConvertTo-Csv
1111
# ConvertTo-Csv
1212

1313
## SYNOPSIS
14+
1415
Converts .NET objects into a series of character-separated value (CSV) strings.
1516

1617
## SYNTAX
@@ -109,7 +110,10 @@ information header from the CSV output.
109110
### -Delimiter
110111

111112
Specifies the delimiter to separate the property values in CSV strings. The default is a comma
112-
(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single
113+
(`,`).
114+
115+
Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single
116+
quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double
113117
quotation marks.
114118

115119
```yaml

reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Utility
5-
ms.date: 03/14/2023
5+
ms.date: 12/27/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
aliases:
@@ -13,6 +13,7 @@ title: Export-Csv
1313
# Export-Csv
1414

1515
## SYNOPSIS
16+
1617
Converts objects into a series of character-separated value (CSV) strings and saves the strings to a
1718
file.
1819

@@ -142,11 +143,12 @@ Get-Content -Path .\Processes.csv
142143
The `Get-Culture` cmdlet uses the nested properties **TextInfo** and **ListSeparator** and displays
143144
the current culture's default list separator. The `Get-Process` cmdlet gets **Process** objects. The
144145
process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts the
145-
process objects to a series of CSV strings. The **Path** parameter specifies that the `Processes.csv`
146-
file is saved in the current directory. The **UseCulture** parameter uses the current culture's
147-
default list separator as the delimiter. The **NoTypeInformation** parameter removes the **#TYPE**
148-
information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet
149-
uses the **Path** parameter to display the file located in the current directory.
146+
process objects to a series of CSV strings. The **Path** parameter specifies that the
147+
`Processes.csv` file is saved in the current directory. The **UseCulture** parameter uses the
148+
current culture's default list separator as the delimiter. The **NoTypeInformation** parameter
149+
removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6.
150+
The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current
151+
directory.
150152

151153
### Example 5: Export processes with type information
152154

@@ -176,10 +178,15 @@ This example describes how to export objects to a CSV file and use the **Append*
176178
objects to an existing file.
177179

178180
```powershell
179-
$AppService = (Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status)
181+
$AppService = Get-Service -DisplayName *Application* |
182+
Select-Object -Property DisplayName, Status
183+
180184
$AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation
181185
Get-Content -Path .\Services.Csv
182-
$WinService = (Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status)
186+
187+
$WinService = Get-Service -DisplayName *Windows* |
188+
Select-Object -Property DisplayName, Status
189+
183190
$WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append
184191
Get-Content -Path .\Services.Csv
185192
```
@@ -218,7 +225,8 @@ unexpected output is received, troubleshoot the pipeline syntax.
218225

219226
```powershell
220227
Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear |
221-
Export-Csv -Path .\DateTime.csv -NoTypeInformation
228+
Export-Csv -Path .\DateTime.csv -NoTypeInformation
229+
222230
Get-Content -Path .\DateTime.csv
223231
```
224232

@@ -229,7 +237,8 @@ Get-Content -Path .\DateTime.csv
229237

230238
```powershell
231239
Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear |
232-
Export-Csv -Path .\FTDateTime.csv -NoTypeInformation
240+
Export-Csv -Path .\FTDateTime.csv -NoTypeInformation
241+
233242
Get-Content -Path .\FTDateTime.csv
234243
```
235244

@@ -245,10 +254,10 @@ Get-Content -Path .\FTDateTime.csv
245254
The `Get-Date` cmdlet gets the **DateTime** object. The object is sent down the pipeline to the
246255
`Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to select a subset of object
247256
properties. The object is sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts
248-
the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved in
249-
the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header
250-
from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path**
251-
parameter to display the CSV file located in the current directory.
257+
the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved
258+
in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information
259+
header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the
260+
**Path** parameter to display the CSV file located in the current directory.
252261

253262
When the `Format-Table` cmdlet is used within the pipeline to select properties unexpected results
254263
are received. `Format-Table` sends table format objects down the pipeline to the `Export-Csv` cmdlet
@@ -372,8 +381,11 @@ Accept wildcard characters: False
372381
373382
### -Delimiter
374383
375-
Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a
376-
character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks.
384+
Specifies a delimiter to separate the property values. The default is a comma (`,`).
385+
386+
Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single
387+
quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double
388+
quotation marks.
377389

378390
```yaml
379391
Type: System.Char

0 commit comments

Comments
 (0)