Skip to content

Update Example 5 in Get-Process.md #1923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions reference/3.0/Microsoft.PowerShell.Management/Get-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 12 additions & 6 deletions reference/4.0/Microsoft.PowerShell.Management/Get-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
23 changes: 12 additions & 11 deletions reference/5.0/Microsoft.PowerShell.Management/Get-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
23 changes: 12 additions & 11 deletions reference/5.1/Microsoft.PowerShell.Management/Get-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
23 changes: 12 additions & 11 deletions reference/6/Microsoft.PowerShell.Management/Get-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down