From b9f5fbb9db154e6a3dbfcd5c181819a929b775b1 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Tue, 5 Dec 2017 17:47:24 +0900 Subject: [PATCH] Update Example 5 in Get-Process.md --- .../Get-Process.md | 20 +++++++++++----- .../Get-Process.md | 18 ++++++++++----- .../Get-Process.md | 23 ++++++++++--------- .../Get-Process.md | 23 ++++++++++--------- .../Get-Process.md | 23 ++++++++++--------- 5 files changed, 62 insertions(+), 45 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md b/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md index 474484723bcd..10db0fdf498d 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-Process.md @@ -80,18 +80,26 @@ The first command gets all the processes on the computer and then stores them in The second command uses the InputObject parameter to pass the process objects that are stored in the $a variable to the Get-Process cmdlet. The pipeline operator passes the objects to the Format-Table cmdlet, which formats the processes by using the Priority view. The Priority view, and other views, are defined in the PS1XML format files in the Windows PowerShell home directory ($pshome). + ### Example 5 -``` -PS C:\> get-process powershell -computername S1, localhost | ft @{Label="NPM(K)";Expression={[int]($_.NPM/1024)}}, @{Label="PM(K)";Expression={[int]($_.PM/1024)}},@{Label="WS(K)";Expression={[int]($_.WS/1024)}},@{Label="VM(M)";Expression={[int]($_.VM/1MB)}}, @{Label="CPU(s)";Expression={if ($_.CPU -ne $()) { $_.CPU.ToString("N")}}}, Id, MachineName, ProcessName -auto +```powershell +PS C:\> Get-Process powershell -ComputerName S1, localhost | + ft @{Label = "NPM(K)"; Expression = {[int]($_.NPM / 1024)}}, + @{Label = "PM(K)"; Expression = {[int]($_.PM / 1024)}}, + @{Label = "WS(K)"; Expression = {[int]($_.WS / 1024)}}, + @{Label = "VM(M)"; Expression = {[int]($_.VM / 1MB)}}, + @{Label = "CPU(s)"; Expression = {if ($_.CPU) {$_.CPU.ToString("N")}}}, + Id, MachineName, ProcessName -Auto NPM(K) PM(K) WS(K) VM(M) CPU(s) Id MachineName ProcessName ------ ----- ----- ----- ------ -- ----------- ----------- -6 23500 31340 142 1980 S1 powershell -6 23500 31348 142 4016 S1 powershell -27 54572 54520 576 4428 localhost powershell + 6 23500 31340 142 1.70 1980 S1 powershell + 6 23500 31348 142 2.75 4016 S1 powershell + 27 54572 54520 576 5.52 4428 localhost powershell ``` -This example provides a Format-Table (alias = ft) command that adds the MachineName property to the standard Get-Process output display. +This example provides a `Format-Table` (alias = ft) command that adds the MachineName property to the standard `Get-Process` output display. + ### Example 6 ``` PS C:\> get-process powershell -fileversioninfo diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md b/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md index f352bea3b094..d4df0ff413d9 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-Process.md @@ -103,17 +103,23 @@ The pipeline operator passes the objects to the Format-Table cmdlet, which forma The Priority view, and other views, are defined in the PS1XML format files in the Windows PowerShell home directory ($pshome). ### Example 5 -``` -PS C:\> get-process powershell -computername S1, localhost | ft @{Label="NPM(K)";Expression={[int]($_.NPM/1024)}}, @{Label="PM(K)";Expression={[int]($_.PM/1024)}},@{Label="WS(K)";Expression={[int]($_.WS/1024)}},@{Label="VM(M)";Expression={[int]($_.VM/1MB)}}, @{Label="CPU(s)";Expression={if ($_.CPU -ne $()) { $_.CPU.ToString("N")}}}, Id, MachineName, ProcessName -auto +```powershell +PS C:\> Get-Process powershell -ComputerName S1, localhost | + ft @{Label = "NPM(K)"; Expression = {[int]($_.NPM / 1024)}}, + @{Label = "PM(K)"; Expression = {[int]($_.PM / 1024)}}, + @{Label = "WS(K)"; Expression = {[int]($_.WS / 1024)}}, + @{Label = "VM(M)"; Expression = {[int]($_.VM / 1MB)}}, + @{Label = "CPU(s)"; Expression = {if ($_.CPU) {$_.CPU.ToString("N")}}}, + Id, MachineName, ProcessName -Auto NPM(K) PM(K) WS(K) VM(M) CPU(s) Id MachineName ProcessName ------ ----- ----- ----- ------ -- ----------- ----------- -6 23500 31340 142 1980 S1 powershell -6 23500 31348 142 4016 S1 powershell -27 54572 54520 576 4428 localhost powershell + 6 23500 31340 142 1.70 1980 S1 powershell + 6 23500 31348 142 2.75 4016 S1 powershell + 27 54572 54520 576 5.52 4428 localhost powershell ``` -This example provides a Format-Table (alias = ft) command that adds the MachineName property to the standard Get-Process output display. +This example provides a `Format-Table` (alias = ft) command that adds the MachineName property to the standard `Get-Process` output display. ### Example 6 ``` diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md b/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md index ee08cc76c039..4d0e20a661b6 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-Process.md @@ -103,22 +103,23 @@ The pipeline operator passes the objects to the **Format-Table** cmdlet, which f The Priority view, and other views, are defined in the PS1XML format files in the Windows PowerShell home directory ($pshome). ### Example 5: Add a property to the standard Get-Process output display -``` -PS C:\> Get-Process Powershell -ComputerName S1, localhost | ft @{Label="NPM(K)";Expression={[int]($_.NPM/1024)}}, @{Label="PM(K)";Expression={[int]($_.PM/1024)}},@{Label="WS(K)";Expression={[int]($_.WS/1024)}},@{Label="VM(M)";Expression={[int]($_.VM/1MB)}}, @{Label="CPU(s)";Expression={if ($_.CPU -ne $()) { $_.CPU.ToString("N")}}}, Id, MachineName, ProcessName -Auto - - - - - +```powershell +PS C:\> Get-Process powershell -ComputerName S1, localhost | + ft @{Label = "NPM(K)"; Expression = {[int]($_.NPM / 1024)}}, + @{Label = "PM(K)"; Expression = {[int]($_.PM / 1024)}}, + @{Label = "WS(K)"; Expression = {[int]($_.WS / 1024)}}, + @{Label = "VM(M)"; Expression = {[int]($_.VM / 1MB)}}, + @{Label = "CPU(s)"; Expression = {if ($_.CPU) {$_.CPU.ToString("N")}}}, + Id, MachineName, ProcessName -Auto NPM(K) PM(K) WS(K) VM(M) CPU(s) Id MachineName ProcessName ------ ----- ----- ----- ------ -- ----------- ----------- -6 23500 31340 142 1980 S1 powershell -6 23500 31348 142 4016 S1 powershell -27 54572 54520 576 4428 localhost powershell + 6 23500 31340 142 1.70 1980 S1 powershell + 6 23500 31348 142 2.75 4016 S1 powershell + 27 54572 54520 576 5.52 4428 localhost powershell ``` -This example provides a **Format-Table** (alias = ft) command that adds the **MachineName** property to the standard **Get-Process** output display. +This example provides a `Format-Table` (alias = ft) command that adds the MachineName property to the standard `Get-Process` output display. ### Example 6: Get version information for a process ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md index ef6667752ed2..a9eb47e22aff 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md @@ -103,22 +103,23 @@ The pipeline operator passes the objects to the **Format-Table** cmdlet, which f The Priority view, and other views, are defined in the PS1XML format files in the Windows PowerShell home directory ($pshome). ### Example 5: Add a property to the standard Get-Process output display -``` -PS C:\> Get-Process Powershell -ComputerName S1, localhost | ft @{Label="NPM(K)";Expression={[int]($_.NPM/1024)}}, @{Label="PM(K)";Expression={[int]($_.PM/1024)}},@{Label="WS(K)";Expression={[int]($_.WS/1024)}},@{Label="VM(M)";Expression={[int]($_.VM/1MB)}}, @{Label="CPU(s)";Expression={if ($_.CPU -ne $()) { $_.CPU.ToString("N")}}}, Id, MachineName, ProcessName -Auto - - - - - +```powershell +PS C:\> Get-Process powershell -ComputerName S1, localhost | + ft @{Label = "NPM(K)"; Expression = {[int]($_.NPM / 1024)}}, + @{Label = "PM(K)"; Expression = {[int]($_.PM / 1024)}}, + @{Label = "WS(K)"; Expression = {[int]($_.WS / 1024)}}, + @{Label = "VM(M)"; Expression = {[int]($_.VM / 1MB)}}, + @{Label = "CPU(s)"; Expression = {if ($_.CPU) {$_.CPU.ToString("N")}}}, + Id, MachineName, ProcessName -Auto NPM(K) PM(K) WS(K) VM(M) CPU(s) Id MachineName ProcessName ------ ----- ----- ----- ------ -- ----------- ----------- -6 23500 31340 142 1980 S1 powershell -6 23500 31348 142 4016 S1 powershell -27 54572 54520 576 4428 localhost powershell + 6 23500 31340 142 1.70 1980 S1 powershell + 6 23500 31348 142 2.75 4016 S1 powershell + 27 54572 54520 576 5.52 4428 localhost powershell ``` -This example provides a **Format-Table** (alias = ft) command that adds the **MachineName** property to the standard **Get-Process** output display. +This example provides a `Format-Table` (alias = ft) command that adds the MachineName property to the standard `Get-Process` output display. ### Example 6: Get version information for a process ``` diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Process.md b/reference/6/Microsoft.PowerShell.Management/Get-Process.md index 0cd95c5dfc8b..89bb191d56a4 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Process.md @@ -108,22 +108,23 @@ The pipeline operator passes the objects to the **Format-Table** cmdlet, which f The Priority view, and other views, are defined in the PS1XML format files in the Windows PowerShell home directory ($pshome). ### Example 5: Add a property to the standard Get-Process output display -``` -PS C:\> Get-Process Powershell -ComputerName S1, localhost | ft @{Label="NPM(K)";Expression={[int]($_.NPM/1024)}}, @{Label="PM(K)";Expression={[int]($_.PM/1024)}},@{Label="WS(K)";Expression={[int]($_.WS/1024)}},@{Label="VM(M)";Expression={[int]($_.VM/1MB)}}, @{Label="CPU(s)";Expression={if ($_.CPU -ne $()) { $_.CPU.ToString("N")}}}, Id, MachineName, ProcessName -Auto - - - - - +```powershell +PS C:\> Get-Process pwsh | + ft @{Label = "NPM(K)"; Expression = {[int]($_.NPM / 1024)}}, + @{Label = "PM(K)"; Expression = {[int]($_.PM / 1024)}}, + @{Label = "WS(K)"; Expression = {[int]($_.WS / 1024)}}, + @{Label = "VM(M)"; Expression = {[int]($_.VM / 1MB)}}, + @{Label = "CPU(s)"; Expression = {if ($_.CPU) {$_.CPU.ToString("N")}}}, + Id, MachineName, ProcessName -Auto NPM(K) PM(K) WS(K) VM(M) CPU(s) Id MachineName ProcessName ------ ----- ----- ----- ------ -- ----------- ----------- -6 23500 31340 142 1980 S1 powershell -6 23500 31348 142 4016 S1 powershell -27 54572 54520 576 4428 localhost powershell + 6 23500 31340 142 1.70 1980 . pwsh + 6 23500 31348 142 2.75 4016 . pwsh + 27 54572 54520 576 5.52 4428 . pwsh ``` -This example provides a **Format-Table** (alias = ft) command that adds the **MachineName** property to the standard **Get-Process** output display. +This example provides a `Format-Table` (alias = ft) command that adds the MachineName property to the standard `Get-Process` output display. ### Example 6: Get version information for a process ```