Get-PSHostProcessInfo

Gets process information about the PowerShell host.

Syntax

Get-PSHostProcessInfo
   [[-Name] <String[]>]
   [<CommonParameters>]
Get-PSHostProcessInfo
   [-Process] <Process[]>
   [<CommonParameters>]
Get-PSHostProcessInfo
   [-Id] <Int32[]>
   [<CommonParameters>]

Examples

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

Get-PSHostProcessInfo

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

2: Get PowerShell host information for a specific process

Get-PSHostProcessInfo -Id 14676

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.

Type:Int32[]
Position:0
Default value:None
Accept pipeline input:False
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.

Type:String[]
Position:0
Default value:None
Accept pipeline input:False
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.

Type:Process[]
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Inputs

System.Diagnostics.Process

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

Outputs

Microsoft.PowerShell.Commands.PSHostProcessInfo