DotNetZip ExtractProgress events in PowerShell -
i'm extracting zip file in powershell using dotnetzip library, , want display progress. i'm using next code:
try { $zip = [ionic.zip.zipfile]::read($zipfilename) register-objectevent ` -inputobject $zip ` -eventname extractprogress ` -sourceidentifier extractprogress ` -action { [console]::beep() write-host $sender write-host $sourceeventargs } | out-null $zip.extractall($destination, 'overwritesilently') } { unregister-event -sourceidentifier extractprogress $zip.dispose() } my problem don't see events (no beep, no write-host) until end. i'm expecting see progress events during process.
initially, thought because register-objectevent queued events, powershell help says -action invoked immediately, without event beingness queued.
if write equivalent code in c# console application, see progress events each file extracted, expected, means (as far can tell) dotnetzip doing right thing. note events raised on same thread called extractall.
what doing wrong?
(windows 7 x64, powershell 2.0, configured utilize .net 4.0)
powershell dotnetzip
No comments:
Post a Comment