Skip to content

Conversation

@surfingoldelephant
Copy link
Contributor

PR Summary

This PR fixes various .ps1xml formatting file doc issues.

  • Fixes the wrong paths used in about_Format.ps1xml examples.
    • Example paths are also now consistent across all doc versions.
  • Creates the directory used in the first example to avoid errors (Copy-Item/Export-FormatData doesn't create missing directories).
  • Fixes the incorrect assertion that formatting files must use .format.ps1xml (only .ps1xml is required).
  • Adds a more generalized note about file signing to the developer doc.
  • Replaces Windows-specific references to a cross-platform alternative (e.g., Notepad -> Visual Studio Code).
  • Various style changes.

PR Checklist

  • Descriptive Title: This PR's title is a synopsis of the changes it proposes.
  • Summary: This PR's summary describes the scope and intent of the change.
  • Contributor's Guide: I have read the contributor's guide.
  • Style: This PR adheres to the style guide.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod

This comment was marked as outdated.

@surfingoldelephant surfingoldelephant changed the title Format file doc corrections .ps1xml formatting file doc corrections Dec 26, 2025
surfingoldelephant and others added 10 commits January 2, 2026 14:44
This fixes the wrong path used in both `Update-FormatData` examples.

The paths used to initially create the custom formatting files are
.\MyDotNetTypes.Format.ps1xml and .\MyFileSystem.Format.ps1xml.

Before this change, Update-FormatData -PrependPath incorrectly pointed
to $HOME\Format\CultureInfo.Format.ps1xml and
$PSHOME\Format\MyFileSystem.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.
This fixes the incorrect assertion that formatting files **must** use
`.format.ps1xml` (only `.ps1xml` is required).
The original note suggests that after copying Win PS formatting
files, the signature block should be replaced. However, the files don't
actually contain a signature block to begin with. This may cause
confusion, so the note is updated with a more generalized suggestion on
signing taken from about_Format.ps1xml.

Also includes minor style changes and less Windows-specific references.
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.
@michaeltlombardi michaeltlombardi force-pushed the formatFileDocCorrections branch from 0f2da98 to 5d421c4 Compare January 2, 2026 20:44
@learn-build-service-prod

This comment was marked as outdated.

1 similar comment
@learn-build-service-prod
Copy link
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

This comment was marked as outdated.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 5d421c4:

✅ Validation status: passed

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md ✅Succeeded View (powershell-5.1)
reference/7.4/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md ✅Succeeded View (powershell-7.4)
reference/7.5/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md ✅Succeeded View (powershell-7.5)
reference/7.6/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md ✅Succeeded View (powershell-7.6)
reference/docs-conceptual/developer/format/how-to-create-a-formatting-file-format-ps1xml.md ✅Succeeded View (>=powershell-5.1)

For more details, please refer to the build report.

@michaeltlombardi michaeltlombardi merged commit 6c4d0ff into MicrosoftDocs:main Jan 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants