Get-PSHostProcessInfo

Gets process information about the PowerShell host.

语法

ProcessNameParameterSet (默认值)

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

ProcessParameterSet

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

ProcessIdParameterSet

Get-PSHostProcessInfo
    [-Id] <Int32[]>
    [<CommonParameters>]

示例

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

Get-PSHostProcessInfo
ProcessName ProcessId AppDomainName
----------- --------- -------------
powershell       6956 DefaultAppDomain
powershell       4856 DefaultAppDomain
wsmprovhost      1780 DefaultAppDomain

2: Get PowerShell host information for a specific process

Get-PSHostProcessInfo -Id 6956
ProcessName ProcessId AppDomainName
----------- --------- -------------
powershell       6956 DefaultAppDomain

参数

-Id

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

参数属性

类型:

Int32[]

默认值:None
支持通配符:False
不显示:False

参数集

ProcessIdParameterSet
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值: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.

参数属性

类型:

String[]

默认值:None
支持通配符:False
不显示:False

参数集

ProcessNameParameterSet
Position:0
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值: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.

参数属性

类型:

Process[]

默认值:None
支持通配符:False
不显示:False

参数集

ProcessParameterSet
Position:0
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

输入

Process

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

输出

PSHostProcessInfo