diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md b/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md index af2d789f8cde..474484723bcd 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md @@ -144,23 +144,29 @@ The second command uses the GetOwner method to get the owner of the process in $ The output reveals that the owner is Domain01\user01. ### Example 9 -``` -PS C:\> get-process powershell +```powershell +PS C:\> Get-Process powershell Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -308 26 52308 61780 567 3.18 5632 powershell -377 26 62676 63384 575 3.88 5888 powershell PS C:\> get-process -id $pid +308 26 52308 61780 567 3.18 5632 powershell +377 26 62676 63384 575 3.88 5888 powershell + + +PS C:\> Get-Process -Id $PID + Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -396 26 56488 57236 575 3.90 5888 powershell +396 26 56488 57236 575 3.90 5888 powershell ``` -These commands show how to use the $pid automatic variable to identify the process that is hosting the current Windows PowerShell session. -You can use this method to distinguish the host process from other Windows PowerShell processes that you might want to stop or close. -The first command gets all of the Windows PowerShell processes in the current session. +These commands show how to use the $PID automatic variable to identify the process that is hosting the current PowerShell session. +You can use this method to distinguish the host process from other PowerShell processes that you might want to stop or close. + +The first command gets all of the PowerShell processes in the current session. + +The second command gets the PowerShell process that is hosting the current session. -The second command gets the Windows PowerShell process that is hosting the current session. ### Example 10 ``` PS C:\> get-process | where {$_.mainWindowTitle} | format-table id, name, mainwindowtitle -autosize diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md b/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md index 753afc27a53d..f352bea3b094 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md @@ -178,23 +178,28 @@ The third command uses the GetOwner method to get the owner of the process in $p The output reveals that the owner is Domain01\user01. ### Example 9 -``` -PS C:\> get-process powershell +```powershell +PS C:\> Get-Process powershell Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -308 26 52308 61780 567 3.18 5632 powershell -377 26 62676 63384 575 3.88 5888 powershell PS C:\> get-process -id $pid +308 26 52308 61780 567 3.18 5632 powershell +377 26 62676 63384 575 3.88 5888 powershell + + +PS C:\> Get-Process -Id $PID + Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -396 26 56488 57236 575 3.90 5888 powershell +396 26 56488 57236 575 3.90 5888 powershell ``` -These commands show how to use the $pid automatic variable to identify the process that is hosting the current Windows PowerShell session. -You can use this method to distinguish the host process from other Windows PowerShell processes that you might want to stop or close. -The first command gets all of the Windows PowerShell processes in the current session. +These commands show how to use the $PID automatic variable to identify the process that is hosting the current PowerShell session. +You can use this method to distinguish the host process from other PowerShell processes that you might want to stop or close. + +The first command gets all of the PowerShell processes in the current session. -The second command gets the Windows PowerShell process that is hosting the current session. +The second command gets the PowerShell process that is hosting the current session. ### Example 10 ``` diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md b/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md index 1de9a14768e2..ee08cc76c039 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md @@ -186,30 +186,28 @@ The third command uses the GetOwner method to get the owner of the process in $p The output reveals that the owner is Domain01\user01. ### Example 9: Use an automatic variable to identify the process hosting the current session -``` +```powershell PS C:\> Get-Process powershell - - - - Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 308 26 52308 61780 567 3.18 5632 powershell -377 26 62676 63384 575 3.88 5888 powershell PS C:\> Get-Process -Id $pid +377 26 62676 63384 575 3.88 5888 powershell +PS C:\> Get-Process -Id $PID Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 396 26 56488 57236 575 3.90 5888 powershell ``` -These commands show how to use the $pid automatic variable to identify the process that is hosting the current Windows PowerShell session. -You can use this method to distinguish the host process from other Windows PowerShell processes that you might want to stop or close. -The first command gets all of the Windows PowerShell processes in the current session. +These commands show how to use the $PID automatic variable to identify the process that is hosting the current PowerShell session. +You can use this method to distinguish the host process from other PowerShell processes that you might want to stop or close. + +The first command gets all of the PowerShell processes in the current session. -The second command gets the Windows PowerShell process that is hosting the current session. +The second command gets the PowerShell process that is hosting the current session. ### Example 10: Get all processes that have a main window title and display them in a table ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md index e62ed8ec69fb..82aefcb627b9 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md @@ -186,30 +186,28 @@ The third command uses the GetOwner method to get the owner of the process in $p The output reveals that the owner is Domain01\user01. ### Example 9: Use an automatic variable to identify the process hosting the current session -``` +```powershell PS C:\> Get-Process powershell - - - - Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 308 26 52308 61780 567 3.18 5632 powershell -377 26 62676 63384 575 3.88 5888 powershell PS C:\> Get-Process -Id $pid +377 26 62676 63384 575 3.88 5888 powershell +PS C:\> Get-Process -Id $PID Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 396 26 56488 57236 575 3.90 5888 powershell ``` -These commands show how to use the $pid automatic variable to identify the process that is hosting the current Windows PowerShell session. -You can use this method to distinguish the host process from other Windows PowerShell processes that you might want to stop or close. -The first command gets all of the Windows PowerShell processes in the current session. +These commands show how to use the $PID automatic variable to identify the process that is hosting the current PowerShell session. +You can use this method to distinguish the host process from other PowerShell processes that you might want to stop or close. + +The first command gets all of the PowerShell processes in the current session. -The second command gets the Windows PowerShell process that is hosting the current session. +The second command gets the PowerShell process that is hosting the current session. ### Example 10: Get all processes that have a main window title and display them in a table ``` diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Process.md b/reference/6/Microsoft.PowerShell.Management/Get-Process.md index ee24ceeb0c87..0cd95c5dfc8b 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Process.md @@ -165,30 +165,28 @@ On Windows, the **IncludeUserName** parameter requires elevated user rights (Run The output reveals that the owner is Domain01\user01. ### Example 9: Use an automatic variable to identify the process hosting the current session -``` -PS C:\> Get-Process powershell - - - - +```powershell +PS C:\> Get-Process pwsh -Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------- ------ ----- ----- ----- ------ -- ----------- -308 26 52308 61780 567 3.18 5632 powershell -377 26 62676 63384 575 3.88 5888 powershell PS C:\> Get-Process -Id $pid + NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName + ------ ----- ----- ------ -- -- ----------- + 83 96.21 105.95 4.33 1192 10 pwsh + 79 83.81 117.61 2.16 10580 10 pwsh +PS C:\> Get-Process -Id $PID -Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------- ------ ----- ----- ----- ------ -- ----------- -396 26 56488 57236 575 3.90 5888 powershell + NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName + ------ ----- ----- ------ -- -- ----------- + 83 96.21 77.53 4.39 1192 10 pwsh ``` -These commands show how to use the $pid automatic variable to identify the process that is hosting the current Windows PowerShell session. -You can use this method to distinguish the host process from other Windows PowerShell processes that you might want to stop or close. -The first command gets all of the Windows PowerShell processes in the current session. +These commands show how to use the $PID automatic variable to identify the process that is hosting the current PowerShell session. +You can use this method to distinguish the host process from other PowerShell processes that you might want to stop or close. + +The first command gets all of the PowerShell processes in the current session. -The second command gets the Windows PowerShell process that is hosting the current session. +The second command gets the PowerShell process that is hosting the current session. ### Example 10: Get all processes that have a main window title and display them in a table ```