Skip to content

Conversation

surfingoldelephant
Copy link
Contributor

PR Summary

This PR makes the following improvements to the Get-Process documentation.

Fixes

  • Ensures the versioned docs refer to the correct:
    • PowerShell host
    • Default display columns/properties for Process objects, including the correct units/descriptions
  • Improves example 4 by sorting objects before piping to Format-Table -View Priority, ensuring Process objects are grouped by priority correctly.
  • Removes the incorrect assertion that -IncludeUserName requires elevation outright in v7.x.
  • Removes v7.x doc references to .ps1xml files in the PowerShell home directory.
  • Adds named parameters to code examples where appropriate and fixes syntax inconsistencies.
  • A general refresh of markdown formatting and minor verbiage changes.

Additions

  • Adds a definition for "process module", which is referenced throughout the docs.
  • Adds a Where-Object comparison statement to example 3 as a concise alternative to the existing code.
  • Adds Get-CimInstance/Invoke-CimMethod code to example 8 as an alternative approach to Get-Process -IncludeUserName.
    • This replaces the obsolete Get-WmiObject code that was present in the Windows PowerShell v5.1 doc.
  • Adds a warning regarding the use of Get-Process with 64-bit processes in a 32-bit PowerShell host.

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 contributors guide.
  • Style: This PR adheres to the style guide.

VM(M) was removed prior to Windows PowerShell v5.1.

Handles was removed in v6.0.
See: PowerShell/PowerShell#1812
This adds a Get-CimInstance/Invoke-CimMethod example as an alternative
approach to Get-Process -IncludeUserName. It replaces the obsolete
Get-WmiObject example that was present in the Windows PowerShell v5.1
doc.

This also removes the incorrect assertion in the v7.x docs that
-IncludeUserName requires elevation outright. That is only true for
v5.1.
The Priority table view for Diagnostics.Process groups on the
PriorityClass property. Format-Table expects input to already be
sorted, but the original example used unsorted data, rendering it
fairly unhelpful.

This adds a call to Sort-Object and sorts on PriorityClass before
calling Format-Table. This ensures all processes are correctly grouped
by the Priority view. A script block is used in lieu of the property
name directly, as the latter surfaces getter exceptions as a
non-terminating error. This will occur with, e.g., PPL processes in
Windows (even when elevated).

Reference to PS home directory .ps1xml files is also removed from the
v7.x docs. Format definitions were moved directly into source code in
v6+.

As a Format-* cmdlet is used, the term "display" is used to emphasize
output is not intended for further processing.
This fixes incorrect markdown formatting and adds link references.

This also ensures Get-Process output examples correctly reflect the PS
version targeted by the doc. E.g., Windows PS v5.1 includes Handles in
its default table view. This was removed in PS v6.0. See PS issue 1812.
Windows PS v5.1 uses (K) in its table view; PS v6.0+ uses (M).

Named parameters are added where appropriate.

Minor verbiage changes and added notes have also been made.
Copy link

Expectations

Thanks for your submission! Here's a quick note to provide you with some context for what to expect from the docs team and the process now that you've submitted a PR. Even if you've contributed to this repo before, we strongly suggest reading this information; it might have changed since you last read it.

To see our process for reviewing PRs, please read our editor's checklist and process for managing pull requests in particular. Below is a brief, high-level summary of what to expect, but our contributor guide has expanded details.

The docs team begins to review your PR if you request them to or if your PR meets these conditions:

  • It is not a draft PR.
  • It does not have a WIP prefix in the title.
  • It passes validation and build steps.
  • It does not have any merge conflicts.
  • You have checked every box in the PR Checklist, indicating you have completed all required steps and marked your PR as Ready to Merge.

You can always request a review at any stage in your authoring process, the docs team is here to help! You do not need to submit a fully polished and finished draft; the docs team can help you get content ready for merge.

While reviewing your PR, the docs team may make suggestions, write comments, and ask questions. When all requirements are satisfied, the docs team marks your PR as Approved and merges it. Once your PR is merged, it is included the next time the documentation is published. For this project, the documentation is published daily at 3 p.m. Pacific Standard Time (PST).

@surfingoldelephant surfingoldelephant changed the title Get process fixes and refresh Get-Process fixes and refresh Apr 15, 2025
Copy link
Contributor

Learn Build status updates of commit 3f3ecd2:

⚠️ Validation status: warnings

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Management/Get-Process.md ⚠️Warning View (powershell-5.1) Details
reference/7.4/Microsoft.PowerShell.Management/Get-Process.md ⚠️Warning View (powershell-7.4) Details
reference/7.5/Microsoft.PowerShell.Management/Get-Process.md ⚠️Warning View (powershell-7.5) Details
reference/7.6/Microsoft.PowerShell.Management/Get-Process.md ⚠️Warning View (powershell-7.6) Details

reference/5.1/Microsoft.PowerShell.Management/Get-Process.md

  • Line 0, Column 0: [Warning: link-out-of-scope - See documentation] File '5.1/Microsoft.PowerShell.Core/Where-Object.md' referenced by link '../Microsoft.PowerShell.Core/Where-Object.md#description' will not be built because it is not included in build scope.

reference/7.4/Microsoft.PowerShell.Management/Get-Process.md

  • Line 0, Column 0: [Warning: link-out-of-scope - See documentation] File '7.4/Microsoft.PowerShell.Core/Where-Object.md' referenced by link '../Microsoft.PowerShell.Core/Where-Object.md#description' will not be built because it is not included in build scope.

reference/7.5/Microsoft.PowerShell.Management/Get-Process.md

  • Line 0, Column 0: [Warning: link-out-of-scope - See documentation] File '7.5/Microsoft.PowerShell.Core/Where-Object.md' referenced by link '../Microsoft.PowerShell.Core/Where-Object.md#description' will not be built because it is not included in build scope.

reference/7.6/Microsoft.PowerShell.Management/Get-Process.md

  • Line 0, Column 0: [Warning: link-out-of-scope - See documentation] File '7.6/Microsoft.PowerShell.Core/Where-Object.md' referenced by link '../Microsoft.PowerShell.Core/Where-Object.md#description' will not be built because it is not included in build scope.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 56c7b7a:

✅ Validation status: passed

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Management/Get-Process.md ✅Succeeded View (powershell-5.1)
reference/7.4/Microsoft.PowerShell.Management/Get-Process.md ✅Succeeded View (powershell-7.4)
reference/7.5/Microsoft.PowerShell.Management/Get-Process.md ✅Succeeded View (powershell-7.5)
reference/7.6/Microsoft.PowerShell.Management/Get-Process.md ✅Succeeded View (powershell-7.6)

For more details, please refer to the build report.

For any questions, please:

@sdwheeler sdwheeler merged commit 36a2e21 into MicrosoftDocs:main Apr 15, 2025
4 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