Skip to content

Commit 54bde41

Browse files
Use consistent paths in 7.x about_Format.ps1xml
Both Update-FormatData examples now use the $HOME\Format example path. This also updates the first example to create the directory before calling Export-FormatData, as the directory doesn't exist by default and Export-FormatData fails if part of the path is missing.
1 parent a197979 commit 54bde41

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Beginning in PowerShell 6, the default views for objects are defined in PowerShell source code. 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-7.4&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Format.ps1xml
@@ -93,8 +93,10 @@ To begin, get the format data from the source code file and create a
9393
`Format.ps1xml` file that contains the current view of the culture objects.
9494

9595
```powershell
96+
[void] (New-Item -Path $HOME\Format -ItemType Directory)
97+
9698
Get-FormatData -TypeName System.Globalization.CultureInfo |
97-
Export-FormatData -Path $HOME\Format\CultureInfo.Format.ps1xml
99+
Export-FormatData -LiteralPath $HOME\Format\CultureInfo.Format.ps1xml
98100
```
99101

100102
Open the `CultureInfo.Format.ps1xml` file in any XML or text editor, such as
@@ -349,8 +351,8 @@ specific PowerShell version.
349351

350352
```powershell
351353
Get-FormatData -PowerShellVersion 5.1 -TypeName System.IO.DirectoryInfo |
352-
Export-FormatData -Path ./MyGciView.Format.ps1xml
353-
Update-FormatData -AppendPath ./MyGciView.Format.ps1xml
354+
Export-FormatData -LiteralPath $HOME\Format\MyGciView.Format.ps1xml
355+
Update-FormatData -AppendPath $HOME\Format\MyGciView.Format.ps1xml
354356
```
355357

356358
```xml

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Beginning in PowerShell 6, the default views for objects are defined in PowerShell source code. 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-7.5&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Format.ps1xml
@@ -93,8 +93,10 @@ To begin, get the format data from the source code file and create a
9393
`Format.ps1xml` file that contains the current view of the culture objects.
9494

9595
```powershell
96+
[void] (New-Item -Path $HOME\Format -ItemType Directory)
97+
9698
Get-FormatData -TypeName System.Globalization.CultureInfo |
97-
Export-FormatData -Path $HOME\Format\CultureInfo.Format.ps1xml
99+
Export-FormatData -LiteralPath $HOME\Format\CultureInfo.Format.ps1xml
98100
```
99101

100102
Open the `CultureInfo.Format.ps1xml` file in any XML or text editor, such as
@@ -349,8 +351,8 @@ specific PowerShell version.
349351

350352
```powershell
351353
Get-FormatData -PowerShellVersion 5.1 -TypeName System.IO.DirectoryInfo |
352-
Export-FormatData -Path ./MyGciView.Format.ps1xml
353-
Update-FormatData -AppendPath ./MyGciView.Format.ps1xml
354+
Export-FormatData -Path $HOME\Format\MyGciView.Format.ps1xml
355+
Update-FormatData -AppendPath $HOME\Format\MyGciView.Format.ps1xml
354356
```
355357

356358
```xml

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Beginning in PowerShell 6, the default views for objects are defined in PowerShell source code. 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-7.6&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Format.ps1xml
@@ -93,8 +93,10 @@ To begin, get the format data from the source code file and create a
9393
`Format.ps1xml` file that contains the current view of the culture objects.
9494

9595
```powershell
96+
[void] (New-Item -Path $HOME\Format -ItemType Directory)
97+
9698
Get-FormatData -TypeName System.Globalization.CultureInfo |
97-
Export-FormatData -Path $HOME\Format\CultureInfo.Format.ps1xml
99+
Export-FormatData -LiteralPath $HOME\Format\CultureInfo.Format.ps1xml
98100
```
99101

100102
Open the `CultureInfo.Format.ps1xml` file in any XML or text editor, such as
@@ -349,8 +351,8 @@ specific PowerShell version.
349351

350352
```powershell
351353
Get-FormatData -PowerShellVersion 5.1 -TypeName System.IO.DirectoryInfo |
352-
Export-FormatData -Path ./MyGciView.Format.ps1xml
353-
Update-FormatData -AppendPath ./MyGciView.Format.ps1xml
354+
Export-FormatData -Path $HOME\Format\MyGciView.Format.ps1xml
355+
Update-FormatData -AppendPath $HOME\Format\MyGciView.Format.ps1xml
354356
```
355357

356358
```xml

0 commit comments

Comments
 (0)