Closed romphreak closed 4 years ago
When using the Wait-UAJob cmdlet (either via pipeline or by itself), the powershell session hangs indefinitely and cannot be cancelled.
Steps to reproduce the behavior: (Example)
The command to complete and the powershell session to be usable again.
$script = New-UAScript -Name FOO -ScriptBlock {Get-Process} Invoke-UAScript $script | Wait-UAJob
-or-
$script = New-UAScript -Name FOO -ScriptBlock {Get-Process} $job = Invoke-UAScript $script Wait-UAJob -JobId $job.Id
Wait-UAJob was throwing an exception internally which was causing it to wait forever. This has been resolved.
Describe the Issue
When using the Wait-UAJob cmdlet (either via pipeline or by itself), the powershell session hangs indefinitely and cannot be cancelled.
To Reproduce
Steps to reproduce the behavior: (Example)
Expected behavior
The command to complete and the powershell session to be usable again.
Screenshots
Script Sample
$script = New-UAScript -Name FOO -ScriptBlock {Get-Process} Invoke-UAScript $script | Wait-UAJob
-or-
$script = New-UAScript -Name FOO -ScriptBlock {Get-Process} $job = Invoke-UAScript $script Wait-UAJob -JobId $job.Id
Version Information