mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Bring back MainWindowTitle in PSHostProcessInfo (#11885)
* Bring back MainWindowTitle in PSHostProcessInfo * Add test
This commit is contained in:
@@ -765,7 +765,6 @@ namespace Microsoft.PowerShell.Commands
|
||||
private set;
|
||||
}
|
||||
|
||||
#if !CORECLR
|
||||
/// <summary>
|
||||
/// Main window title of the process.
|
||||
/// </summary>
|
||||
@@ -774,7 +773,6 @@ namespace Microsoft.PowerShell.Commands
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -794,7 +792,6 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
if (string.IsNullOrEmpty(appDomainName)) { throw new PSArgumentNullException("appDomainName"); }
|
||||
|
||||
#if !CORECLR
|
||||
MainWindowTitle = string.Empty;
|
||||
try
|
||||
{
|
||||
@@ -803,7 +800,6 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
catch (ArgumentException) { }
|
||||
catch (InvalidOperationException) { }
|
||||
#endif
|
||||
|
||||
this.ProcessName = processName;
|
||||
this.ProcessId = processId;
|
||||
|
||||
@@ -29,6 +29,11 @@ Describe "Get-PSHostProcessInfo tests" -Tag CI {
|
||||
(Get-PSHostProcessInfo).ProcessId | Should -Contain $PID
|
||||
}
|
||||
|
||||
It "Should return own self window title" {
|
||||
$expected = (Get-Process -Id $PID).MainWindowTitle
|
||||
(Get-PSHostProcessInfo -Id $PID).MainWindowTitle | Should -BeExactly $expected
|
||||
}
|
||||
|
||||
It "Should list info for other PowerShell hosted processes" {
|
||||
# Creation of the named pipe is async
|
||||
Wait-UntilTrue {
|
||||
|
||||
Reference in New Issue
Block a user