Skip to content

Commit b3bfac6

Browse files
Use the same example path in all doc versions
The 7.x docs use `$HOME\Format` as an example directory. This updates the 5.1 doc to use the same path. It also removes the suggestion to place custom formatting files in Win PS's `$PSHOME`. As this is a system directory, it's not an appropriate location for user files.
1 parent fc465d2 commit b3bfac6

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line 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
@@ -144,13 +142,15 @@ C:\Windows\System32\WindowsPowerShell\v1.0\DotNetTypes.format.ps1xml:115:
144142
This command reveals that the definition is in the `DotNetTypes.format.ps1xml`
145143
file.
146144

147-
The next command copies the file contents to a new file,
148-
`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.
149147

150148
```powershell
149+
[void] (New-Item -Path $HOME\Format -ItemType Directory -Force)
150+
151151
$copyParams = @{
152152
LiteralPath = "$PSHOME\DotNetTypes.format.ps1xml"
153-
Destination = '.\MyDotNetTypes.Format.ps1xml'
153+
Destination = "$HOME\Format\MyDotNetTypes.Format.ps1xml"
154154
}
155155
Copy-Item @copyParams
156156
```
@@ -295,7 +295,7 @@ higher precedence order than the original file. For more information, see
295295
[Update-FormatData][03].
296296

297297
```powershell
298-
Update-FormatData -PrependPath .\MyDotNetTypes.Format.ps1xml
298+
Update-FormatData -PrependPath $HOME\Format\MyDotNetTypes.Format.ps1xml
299299
```
300300

301301
To test the change, type `Get-Culture` and review the output that includes the
@@ -461,11 +461,11 @@ Select-String @selectParams
461461
462462
$copyParams = @{
463463
LiteralPath = "$PSHOME\FileSystem.format.ps1xml"
464-
Destination = '.\MyFileSystem.Format.ps1xml'
464+
Destination = "$HOME\Format\MyFileSystem.Format.ps1xml"
465465
}
466466
Copy-Item @copyParams
467467
468-
Update-FormatData -PrependPath .\MyFileSystem.Format.ps1xml
468+
Update-FormatData -PrependPath $HOME\Format\MyFileSystem.Format.ps1xml
469469
```
470470

471471
> [!NOTE]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ 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)
96+
[void] (New-Item -Path $HOME\Format -ItemType Directory -Force)
9797
9898
Get-FormatData -TypeName System.Globalization.CultureInfo |
9999
Export-FormatData -LiteralPath $HOME\Format\CultureInfo.Format.ps1xml

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ 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)
96+
[void] (New-Item -Path $HOME\Format -ItemType Directory -Force)
9797
9898
Get-FormatData -TypeName System.Globalization.CultureInfo |
9999
Export-FormatData -LiteralPath $HOME\Format\CultureInfo.Format.ps1xml

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ 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)
96+
[void] (New-Item -Path $HOME\Format -ItemType Directory -Force)
9797
9898
Get-FormatData -TypeName System.Globalization.CultureInfo |
9999
Export-FormatData -LiteralPath $HOME\Format\CultureInfo.Format.ps1xml

0 commit comments

Comments
 (0)