mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix blocking wait when starting file associated with a Windows application (#13750)
* Fix blocking wait when starting file associated with a Windows application in elevated process * refactor check if app is WindowsApp
This commit is contained in:
@@ -144,6 +144,15 @@ Describe "Native Command Processor" -tags "Feature" {
|
||||
It '$ErrorActionPreference does not apply to redirected stderr output' -Skip:(!$EnabledExperimentalFeatures.Contains('PSNotApplyErrorActionToStderr')) {
|
||||
pwsh -noprofile -command '$ErrorActionPreference = ''Stop''; testexe -stderr stop 2>$null; ''hello''; $error; $?' | Should -BeExactly 'hello','True'
|
||||
}
|
||||
|
||||
It 'Can start an elevated associated process correctly' -Skip:(
|
||||
!$IsWindows -or (!(Test-Path (Join-Path -Path $env:windir -ChildPath 'system32' -AdditionalChildPath 'diskmgmt.msc')))
|
||||
) {
|
||||
# test bug https://github.com/PowerShell/PowerShell/issues/13744 where console is blocked
|
||||
diskmgmt.msc
|
||||
Wait-UntilTrue -sb { (Get-Process mmc).Count -gt 0 } -TimeoutInMilliseconds 5000 -IntervalInMilliseconds 1000 | Should -BeTrue
|
||||
Get-Process mmc | Stop-Process
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Open a text file with NativeCommandProcessor" -tags @("Feature", "RequireAdminOnWindows") {
|
||||
|
||||
Reference in New Issue
Block a user