mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Forwarding progress stream changes from Foreach-Object -Parallel runspaces (#14271)
This commit is contained in:
+13
@@ -138,6 +138,19 @@ Describe 'ForEach-Object -Parallel Basic Tests' -Tags 'CI' {
|
||||
$actualDebug.Message | Should -BeExactly 'Debug!'
|
||||
}
|
||||
|
||||
It 'Verifies progress data streaming' {
|
||||
|
||||
$ps = [Powershell]::Create([System.Management.Automation.RunspaceMode]::NewRunspace)
|
||||
|
||||
$ps.Commands.AddScript("`$ProgressPreference='Continue'; 1..2 | ForEach-Object -Parallel { Write-Progress -Activity Progress -Status Running }") | Out-Null
|
||||
$ps.Invoke()
|
||||
$pr = $ps.Streams.Progress.ReadAll()
|
||||
$pr.Count | Should -Be 2
|
||||
$pr[0].Activity | Should -Be Progress
|
||||
$pr[0].StatusDescription | Should -Be Running
|
||||
$ps.Dispose()
|
||||
}
|
||||
|
||||
It 'Verifies information data streaming' {
|
||||
|
||||
$actualInformation = 1..1 | ForEach-Object -Parallel { Write-Information "Information!" } 6>&1
|
||||
|
||||
Reference in New Issue
Block a user