Skip to content

Commit e46ae5b

Browse files
sdwheelerDCtheGeek
authored andcommitted
fix formatting and add examples (#4057)
* fix formatting and add examples * removed ref to task manager - added input type
1 parent 4ac1524 commit e46ae5b

File tree

3 files changed

+129
-36
lines changed

3 files changed

+129
-36
lines changed

reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
ms.date: 06/09/2017
3-
schema: 2.0.0
4-
locale: en-us
5-
keywords: powershell,cmdlet
6-
online version: http://go.microsoft.com/fwlink/?LinkId=821487
7-
external help file: System.Management.Automation.dll-Help.xml
8-
title: Get-PSHostProcessInfo
2+
external help file: System.Management.Automation.dll-Help.xml
3+
keywords: powershell,cmdlet
4+
locale: en-us
5+
Module Name: Microsoft.PowerShell.Core
6+
ms.date: 06/09/2017
7+
online version: http://go.microsoft.com/fwlink/?LinkId=821487
8+
schema: 2.0.0
9+
title: Get-PSHostProcessInfo
910
---
10-
1111
# Get-PSHostProcessInfo
1212

1313
## SYNOPSIS
@@ -16,16 +16,19 @@ Gets process information about the PowerShell host.
1616
## SYNTAX
1717

1818
### ProcessNameParameterSet (Default)
19+
1920
```
2021
Get-PSHostProcessInfo [[-Name] <String[]>] [<CommonParameters>]
2122
```
2223

2324
### ProcessParameterSet
25+
2426
```
2527
Get-PSHostProcessInfo [-Process] <Process[]> [<CommonParameters>]
2628
```
2729

2830
### ProcessIdParameterSet
31+
2932
```
3033
Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
3134
```
@@ -34,20 +37,37 @@ Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
3437

3538
## EXAMPLES
3639

37-
### 1:
40+
### 1: Get a list of PowerShell hosts running on the system
41+
42+
```powershell
43+
Get-PSHostProcessInfo
3844
```
39-
PS C:\>
45+
46+
```Output
47+
ProcessName ProcessId AppDomainName
48+
----------- --------- -------------
49+
powershell 6956 DefaultAppDomain
50+
powershell 4856 DefaultAppDomain
51+
wsmprovhost 1780 DefaultAppDomain
4052
```
4153

42-
### 2:
54+
### 2: Get PowerShell host information for a specific process
55+
56+
```powershell
57+
Get-PSHostProcessInfo -Id 6956
4358
```
44-
PS C:\>
59+
60+
```Output
61+
ProcessName ProcessId AppDomainName
62+
----------- --------- -------------
63+
powershell 6956 DefaultAppDomain
4564
```
4665

4766
## PARAMETERS
4867

4968
### -Id
50-
Specifies a process by the process ID. To get a process ID, run the **Get-Process** cmdlet.
69+
70+
Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.
5171

5272
```yaml
5373
Type: Int32[]
@@ -62,7 +82,9 @@ Accept wildcard characters: False
6282
```
6383
6484
### -Name
65-
Specifies a process by the process name. To get a process name, run the **Get-Process** cmdlet. You can also get process names from the Properties dialog box of a process in Task Manager.
85+
86+
Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet. You
87+
can also get process names from the Properties dialog box of a process in Task Manager.
6688

6789
```yaml
6890
Type: String[]
@@ -78,8 +100,9 @@ Accept wildcard characters: False
78100

79101
### -Process
80102

81-
Specifies a process by the process object.
82-
The simplest way to use this parameter is to save the results of a **Get-Process** command that returns process that you want to enter in a variable, and then specify the variable as the value of this parameter.
103+
Specifies a process by the process object. The simplest way to use this parameter is to save the
104+
results of a `Get-Process` command that returns process that you want to enter in a variable, and
105+
then specify the variable as the value of this parameter.
83106

84107
```yaml
85108
Type: Process[]
@@ -94,12 +117,23 @@ Accept wildcard characters: False
94117
```
95118

96119
### CommonParameters
97-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
120+
121+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
122+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
123+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
98124

99125
## INPUTS
100126

127+
### System.Diagnostics.Process
128+
129+
You can pipe a **Process** object from `Get-Process` to this cmdlet.
130+
101131
## OUTPUTS
102132

133+
### Microsoft.PowerShell.Commands.PSHostProcessInfo
134+
103135
## NOTES
104136

105-
## RELATED LINKS
137+
## RELATED LINKS
138+
139+
[Get-Process](../Microsoft.PowerShell.Management/get-process.md)

reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ online version: http://go.microsoft.com/fwlink/?LinkId=821487
88
schema: 2.0.0
99
title: Get-PSHostProcessInfo
1010
---
11-
1211
# Get-PSHostProcessInfo
1312

1413
## SYNOPSIS
@@ -17,16 +16,19 @@ Gets process information about the PowerShell host.
1716
## SYNTAX
1817

1918
### ProcessNameParameterSet (Default)
19+
2020
```
2121
Get-PSHostProcessInfo [[-Name] <String[]>] [<CommonParameters>]
2222
```
2323

2424
### ProcessParameterSet
25+
2526
```
2627
Get-PSHostProcessInfo [-Process] <Process[]> [<CommonParameters>]
2728
```
2829

2930
### ProcessIdParameterSet
31+
3032
```
3133
Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
3234
```
@@ -35,20 +37,36 @@ Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
3537

3638
## EXAMPLES
3739

38-
### 1:
40+
### 1: Get a list of PowerShell hosts running on the system
41+
42+
```powershell
43+
Get-PSHostProcessInfo
3944
```
40-
PS C:\>
45+
46+
```Output
47+
ProcessName ProcessId AppDomainName MainWindowTitle
48+
----------- --------- ------------- ---------------
49+
powershell 14676 DefaultAppDomain Windows PowerShell
50+
powershell 5184 DefaultAppDomain Windows PowerShell
4151
```
4252

43-
### 2:
53+
### 2: Get PowerShell host information for a specific process
54+
55+
```powershell
56+
Get-PSHostProcessInfo -Id 14676
4457
```
45-
PS C:\>
58+
59+
```Output
60+
ProcessName ProcessId AppDomainName MainWindowTitle
61+
----------- --------- ------------- ---------------
62+
powershell 14676 DefaultAppDomain Windows PowerShell
4663
```
4764

4865
## PARAMETERS
4966

5067
### -Id
51-
Specifies a process by the process ID. To get a process ID, run the **Get-Process** cmdlet.
68+
69+
Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.
5270

5371
```yaml
5472
Type: Int32[]
@@ -63,7 +81,9 @@ Accept wildcard characters: False
6381
```
6482
6583
### -Name
66-
Specifies a process by the process name. To get a process name, run the **Get-Process** cmdlet. You can also get process names from the Properties dialog box of a process in Task Manager.
84+
85+
Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet. You
86+
can also get process names from the Properties dialog box of a process in Task Manager.
6787

6888
```yaml
6989
Type: String[]
@@ -78,8 +98,10 @@ Accept wildcard characters: False
7898
```
7999

80100
### -Process
81-
Specifies a process by the process object.
82-
The simplest way to use this parameter is to save the results of a **Get-Process** command that returns process that you want to enter in a variable, and then specify the variable as the value of this parameter.
101+
102+
Specifies a process by the process object. The simplest way to use this parameter is to save the
103+
results of a `Get-Process` command that returns process that you want to enter in a variable, and
104+
then specify the variable as the value of this parameter.
83105

84106
```yaml
85107
Type: Process[]
@@ -94,12 +116,23 @@ Accept wildcard characters: False
94116
```
95117

96118
### CommonParameters
97-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
119+
120+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
121+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
122+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
98123

99124
## INPUTS
100125

126+
### System.Diagnostics.Process
127+
128+
You can pipe a **Process** object from `Get-Process` to this cmdlet.
129+
101130
## OUTPUTS
102131

132+
### Microsoft.PowerShell.Commands.PSHostProcessInfo
133+
103134
## NOTES
104135

105136
## RELATED LINKS
137+
138+
[Get-Process](../Microsoft.PowerShell.Management/get-process.md)

reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,37 @@ Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
3737

3838
## EXAMPLES
3939

40-
### 1:
40+
### 1: Get a list of PowerShell hosts running on the system
4141

42+
```powershell
43+
Get-PSHostProcessInfo
4244
```
43-
PS C:\>
45+
46+
```Output
47+
ProcessName ProcessId AppDomainName
48+
----------- --------- -------------
49+
powershell 11204 DefaultAppDomain
50+
pwsh 13912 DefaultAppDomain
4451
```
4552

46-
### 2:
53+
### 2: Get PowerShell host information for a specific process name
4754

55+
```powershell
56+
Get-PSHostProcessInfo -Name pwsh
4857
```
49-
PS C:\>
58+
59+
```Output
60+
ProcessName ProcessId AppDomainName
61+
----------- --------- -------------
62+
pwsh 13912 DefaultAppDomain
5063
```
5164

5265
## PARAMETERS
5366

5467
### -Id
5568

69+
Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.
70+
5671
```yaml
5772
Type: Int32[]
5873
Parameter Sets: ProcessIdParameterSet
@@ -67,7 +82,7 @@ Accept wildcard characters: False
6782
6883
### -Name
6984
70-
Specifies a process by the process name. To get a process name, run the **Get-Process** cmdlet. You can also get process names from the Properties dialog box of a process in Task Manager.
85+
Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet.
7186

7287
```yaml
7388
Type: String[]
@@ -83,8 +98,9 @@ Accept wildcard characters: False
8398

8499
### -Process
85100

86-
Specifies a process by the process object.
87-
The simplest way to use this parameter is to save the results of a **Get-Process** command that returns process that you want to enter in a variable, and then specify the variable as the value of this parameter.
101+
Specifies a process by the process object. The simplest way to use this parameter is to save the
102+
results of a `Get-Process` command that returns process that you want to enter in a variable, and
103+
then specify the variable as the value of this parameter.
88104

89105
```yaml
90106
Type: Process[]
@@ -100,12 +116,22 @@ Accept wildcard characters: False
100116

101117
### CommonParameters
102118

103-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
119+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
120+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
121+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
104122

105123
## INPUTS
106124

125+
### System.Diagnostics.Process
126+
127+
You can pipe a **Process** object from `Get-Process` to this cmdlet.
128+
107129
## OUTPUTS
108130

131+
### Microsoft.PowerShell.Commands.PSHostProcessInfo
132+
109133
## NOTES
110134

111135
## RELATED LINKS
136+
137+
[Get-Process](../Microsoft.PowerShell.Management/get-process.md)

0 commit comments

Comments
 (0)