| external help file | System.Management.Automation.dll-Help.xml |
|---|---|
| Locale | en-US |
| Module Name | Microsoft.PowerShell.Core |
| ms.date | 06/09/2017 |
| online version | https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-pshostprocessinfo?view=powershell-7.6&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | Get-PSHostProcessInfo |
Gets process information about the PowerShell host.
Get-PSHostProcessInfo [[-Name] <String[]>] [<CommonParameters>]
Get-PSHostProcessInfo [-Process] <Process[]> [<CommonParameters>]
Get-PSHostProcessInfo [-Id] <Int32[]> [<CommonParameters>]
The Get-PSHostProcessInfo cmdlet gets information about PowerShell host processes running on the
local computer.
Beginning in PowerShell 6.2, this cmdlet is supported on non-Windows platforms.
Get-PSHostProcessInfoProcessName ProcessId AppDomainName
----------- --------- -------------
powershell 11204 DefaultAppDomain
pwsh 13912 DefaultAppDomain
Get-PSHostProcessInfo -Name pwshProcessName ProcessId AppDomainName
----------- --------- -------------
pwsh 13912 DefaultAppDomain
Specifies a process by the process ID. To get a process ID, run the Get-Process cmdlet.
Type: System.Int32[]
Parameter Sets: ProcessIdParameterSet
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a process by the process name. To get a process name, run the Get-Process cmdlet.
Type: System.String[]
Parameter Sets: ProcessNameParameterSet
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies 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: System.Diagnostics.Process[]
Parameter Sets: ProcessParameterSet
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You can pipe a Process object from Get-Process to this cmdlet.