Write-Progress doesn't work and breaks try/catch
Visual Studio 2019 16.3.8
POSH Tools 5.0.4
PS C:\Users\kazakoveo> $PSVersionTable
Name Value
PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Write-Progress still doesn’t work, script is attached
Output for this script is
PS C:\Users\kazakoveo\source\tests\TestPOSH> C:\Users\kazakoveo\source\tests\TestPOSH\TestPOSH\TestPOSH.ps1
[ERROR] Write-Progress : Status(StatusCode=Unknown, Detail="Exception was thrown by han
[ERROR] dler.")
[ERROR] + ~~~~~~~~
[ERROR] C:\Users\kazakoveo\source\tests\TestPOSH\TestPOSH\TestPOSH.ps1:1 знак:1
[ERROR] + Write-Progress -Activity "a" -Status "b"
[ERROR] + FullyQualifiedErrorId : Grpc.Core.RpcException,Microsoft.PowerShell.Comm
[ERROR] ands.WriteProgressCommand
[ERROR] + CategoryInfo : NotSpecified: (:) [Write-Progress], RpcException
[ERROR]
Catch!
The program 'TestPOSH.ps1: PowerShell Script' has exited with code 0 (0x0).
Comments (3)
-
-
Can you please upgrade to 5.0.5 and see if that resolves your issue?
-
- changed status to resolved
- Log in to comment
I think I just reproduced this. It’s a timing issue as to why I wasn’t seeing it before. Can you please run this after you see the error?
\$Error[0].Exception.StackTrace