From 9df075bd95b32390a91c207f9f97cec7b4c50efe Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 26 Mar 2019 08:17:43 -0700 Subject: [PATCH 1/2] fix formatting and add examples --- .../Get-PSHostProcessInfo.md | 68 ++++++++++++++----- .../Get-PSHostProcessInfo.md | 51 +++++++++++--- .../Get-PSHostProcessInfo.md | 41 ++++++++--- 3 files changed, 124 insertions(+), 36 deletions(-) diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index 28946837bb68..1fedd051f566 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -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 @@ -16,16 +16,19 @@ Gets process information about the PowerShell host. ## SYNTAX ### ProcessNameParameterSet (Default) + ``` Get-PSHostProcessInfo [[-Name] ] [] ``` ### ProcessParameterSet + ``` Get-PSHostProcessInfo [-Process] [] ``` ### ProcessIdParameterSet + ``` Get-PSHostProcessInfo [-Id] [] ``` @@ -34,20 +37,37 @@ Get-PSHostProcessInfo [-Id] [] ## 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[] @@ -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[] @@ -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[] @@ -94,12 +117,21 @@ 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 +### None + ## OUTPUTS +### Microsoft.PowerShell.Commands.PSHostProcessInfo + ## NOTES -## RELATED LINKS \ No newline at end of file +## RELATED LINKS + +[Get-Process](../Microsoft.PowerShell.Management/get-process.md) \ No newline at end of file diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index d78c2a42f5ca..1eab93948f9f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -8,7 +8,6 @@ online version: http://go.microsoft.com/fwlink/?LinkId=821487 schema: 2.0.0 title: Get-PSHostProcessInfo --- - # Get-PSHostProcessInfo ## SYNOPSIS @@ -17,16 +16,19 @@ Gets process information about the PowerShell host. ## SYNTAX ### ProcessNameParameterSet (Default) + ``` Get-PSHostProcessInfo [[-Name] ] [] ``` ### ProcessParameterSet + ``` Get-PSHostProcessInfo [-Process] [] ``` ### ProcessIdParameterSet + ``` Get-PSHostProcessInfo [-Id] [] ``` @@ -35,20 +37,36 @@ Get-PSHostProcessInfo [-Id] [] ## 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[] @@ -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[] @@ -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[] @@ -94,12 +116,21 @@ 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 +### None + ## OUTPUTS +### Microsoft.PowerShell.Commands.PSHostProcessInfo + ## NOTES ## RELATED LINKS + +[Get-Process](../Microsoft.PowerShell.Management/get-process.md) \ No newline at end of file diff --git a/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index 7b153284d5cb..3b39cfbcd044 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -37,22 +37,37 @@ Get-PSHostProcessInfo [-Id] [] ## 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 @@ -67,7 +82,8 @@ 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[] @@ -83,8 +99,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[] @@ -100,12 +117,20 @@ 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 +### None + ## OUTPUTS +### Microsoft.PowerShell.Commands.PSHostProcessInfo + ## NOTES ## RELATED LINKS + +[Get-Process](../Microsoft.PowerShell.Management/get-process.md) \ No newline at end of file From 22763d9ee91c8013a5040e3a886a0b5e9fe19e81 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 26 Mar 2019 08:30:00 -0700 Subject: [PATCH 2/2] removed ref to task manager - added input type --- .../5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md | 4 +++- .../5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md | 4 +++- .../6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index 1fedd051f566..b1f42a6faec5 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -124,7 +124,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None +### System.Diagnostics.Process + +You can pipe a **Process** object from `Get-Process` to this cmdlet. ## OUTPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index 1eab93948f9f..9f24c3882796 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -123,7 +123,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None +### System.Diagnostics.Process + +You can pipe a **Process** object from `Get-Process` to this cmdlet. ## OUTPUTS diff --git a/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index 3b39cfbcd044..716f652161e6 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -82,8 +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[] @@ -123,7 +122,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None +### System.Diagnostics.Process + +You can pipe a **Process** object from `Get-Process` to this cmdlet. ## OUTPUTS