Skip to content
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

fix formatting and add examples #4057

Merged
merged 2 commits into from
Mar 26, 2019
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
70 changes: 52 additions & 18 deletions reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
ms.date: 06/09/2017
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
online version: http://go.microsoft.com/fwlink/?LinkId=821487
external help file: System.Management.Automation.dll-Help.xml
title: Get-PSHostProcessInfo
external help file: System.Management.Automation.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: Microsoft.PowerShell.Core
ms.date: 06/09/2017
online version: http://go.microsoft.com/fwlink/?LinkId=821487
schema: 2.0.0
title: Get-PSHostProcessInfo
---

# Get-PSHostProcessInfo

## SYNOPSIS
Expand All @@ -16,16 +16,19 @@ Gets process information about the PowerShell host.
## SYNTAX

### ProcessNameParameterSet (Default)

```
Get-PSHostProcessInfo [[-Name] <String[]>] [<CommonParameters>]
```

### ProcessParameterSet

```
Get-PSHostProcessInfo [-Process] <Process[]> [<CommonParameters>]
```

### ProcessIdParameterSet

```
Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
```
Expand All @@ -34,20 +37,37 @@ Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]

## EXAMPLES

### 1:
### 1: Get a list of PowerShell hosts running on the system

```powershell
Get-PSHostProcessInfo
```
PS C:\>

```Output
ProcessName ProcessId AppDomainName
----------- --------- -------------
powershell 6956 DefaultAppDomain
powershell 4856 DefaultAppDomain
wsmprovhost 1780 DefaultAppDomain
```

### 2:
### 2: Get PowerShell host information for a specific process

```powershell
Get-PSHostProcessInfo -Id 6956
```
PS C:\>

```Output
ProcessName ProcessId AppDomainName
----------- --------- -------------
powershell 6956 DefaultAppDomain
```

## PARAMETERS

### -Id
Specifies a process by the process ID. To get a process ID, run the **Get-Process** cmdlet.

Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.

```yaml
Type: Int32[]
Expand All @@ -62,7 +82,9 @@ Accept wildcard characters: False
```

### -Name
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.

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.

```yaml
Type: String[]
Expand All @@ -78,8 +100,9 @@ Accept wildcard characters: False

### -Process

Specifies a process by the process object.
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.
Specifies a process by the process object. 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.

```yaml
Type: Process[]
Expand All @@ -94,12 +117,23 @@ Accept wildcard characters: False
```

### CommonParameters
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).

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).

## INPUTS

### System.Diagnostics.Process

You can pipe a **Process** object from `Get-Process` to this cmdlet.

## OUTPUTS

### Microsoft.PowerShell.Commands.PSHostProcessInfo

## NOTES

## RELATED LINKS
## RELATED LINKS

[Get-Process](../Microsoft.PowerShell.Management/get-process.md)
53 changes: 43 additions & 10 deletions reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ online version: http://go.microsoft.com/fwlink/?LinkId=821487
schema: 2.0.0
title: Get-PSHostProcessInfo
---

# Get-PSHostProcessInfo

## SYNOPSIS
Expand All @@ -17,16 +16,19 @@ Gets process information about the PowerShell host.
## SYNTAX

### ProcessNameParameterSet (Default)

```
Get-PSHostProcessInfo [[-Name] <String[]>] [<CommonParameters>]
```

### ProcessParameterSet

```
Get-PSHostProcessInfo [-Process] <Process[]> [<CommonParameters>]
```

### ProcessIdParameterSet

```
Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
```
Expand All @@ -35,20 +37,36 @@ Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]

## EXAMPLES

### 1:
### 1: Get a list of PowerShell hosts running on the system

```powershell
Get-PSHostProcessInfo
```
PS C:\>

```Output
ProcessName ProcessId AppDomainName MainWindowTitle
----------- --------- ------------- ---------------
powershell 14676 DefaultAppDomain Windows PowerShell
powershell 5184 DefaultAppDomain Windows PowerShell
```

### 2:
### 2: Get PowerShell host information for a specific process

```powershell
Get-PSHostProcessInfo -Id 14676
```
PS C:\>

```Output
ProcessName ProcessId AppDomainName MainWindowTitle
----------- --------- ------------- ---------------
powershell 14676 DefaultAppDomain Windows PowerShell
```

## PARAMETERS

### -Id
Specifies a process by the process ID. To get a process ID, run the **Get-Process** cmdlet.

Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.

```yaml
Type: Int32[]
Expand All @@ -63,7 +81,9 @@ Accept wildcard characters: False
```

### -Name
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.

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.

```yaml
Type: String[]
Expand All @@ -78,8 +98,10 @@ Accept wildcard characters: False
```

### -Process
Specifies a process by the process object.
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.

Specifies a process by the process object. 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.

```yaml
Type: Process[]
Expand All @@ -94,12 +116,23 @@ Accept wildcard characters: False
```

### CommonParameters
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).

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).

## INPUTS

### System.Diagnostics.Process

You can pipe a **Process** object from `Get-Process` to this cmdlet.

## OUTPUTS

### Microsoft.PowerShell.Commands.PSHostProcessInfo

## NOTES

## RELATED LINKS

[Get-Process](../Microsoft.PowerShell.Management/get-process.md)
42 changes: 34 additions & 8 deletions reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,37 @@ Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]

## EXAMPLES

### 1:
### 1: Get a list of PowerShell hosts running on the system

```powershell
Get-PSHostProcessInfo
```
PS C:\>

```Output
ProcessName ProcessId AppDomainName
----------- --------- -------------
powershell 11204 DefaultAppDomain
pwsh 13912 DefaultAppDomain
```

### 2:
### 2: Get PowerShell host information for a specific process name

```powershell
Get-PSHostProcessInfo -Name pwsh
```
PS C:\>

```Output
ProcessName ProcessId AppDomainName
----------- --------- -------------
pwsh 13912 DefaultAppDomain
```

## PARAMETERS

### -Id

Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.

```yaml
Type: Int32[]
Parameter Sets: ProcessIdParameterSet
Expand All @@ -67,7 +82,7 @@ Accept wildcard characters: False

### -Name

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.
Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet.

```yaml
Type: String[]
Expand All @@ -83,8 +98,9 @@ Accept wildcard characters: False

### -Process

Specifies a process by the process object.
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.
Specifies a process by the process object. 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.

```yaml
Type: Process[]
Expand All @@ -100,12 +116,22 @@ Accept wildcard characters: False

### CommonParameters

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).
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).

## INPUTS

### System.Diagnostics.Process

You can pipe a **Process** object from `Get-Process` to this cmdlet.

## OUTPUTS

### Microsoft.PowerShell.Commands.PSHostProcessInfo

## NOTES

## RELATED LINKS

[Get-Process](../Microsoft.PowerShell.Management/get-process.md)