Skip to content

Conversation

Taojunshen
Copy link
Contributor

PR Summary

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.

sdwheeler and others added 2 commits April 15, 2025 08:59
* Fix process default display column list

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

Handles was removed in v6.0.
See: PowerShell/PowerShell#1812

* Add module definition to Get-Process description

* Add CIM alternative to Get-Process Example 8

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.

* Improve Get-Process Ex 4 Priority grouping

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.

* Add concise alternative to Get-Process Example 3

* Refresh Get-Process style/formatting and examples

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.

* Add warning about Get-Process in a 32-bit PS host

* Remove link references

* Fix links

* Editorial changes and fix link issue

---------

Co-authored-by: Sean Wheeler <[email protected]>
Copy link
Contributor

Learn Build status updates of commit 36a2e21:

✅ Validation status: passed

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

For more details, please refer to the build report.

For any questions, please:

@Taojunshen Taojunshen merged commit 31e2362 into live Apr 15, 2025
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.

3 participants