{"action":"created","issue":{"url":"https://api.github.com/repos/proxb/PoshRSJob/issues/165","repository_url":"https://api.github.com/repos/proxb/PoshRSJob","labels_url":"https://api.github.com/repos/proxb/PoshRSJob/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/proxb/PoshRSJob/issues/165/comments","events_url":"https://api.github.com/repos/proxb/PoshRSJob/issues/165/events","html_url":"https://github.com/proxb/PoshRSJob/issues/165","id":258320447,"number":165,"title":"Wait-RSJob -ShowProgress: -Completed & -Activity (as in Write-Progress)","user":{"login":"flolilo","id":30194876,"avatar_url":"https://avatars0.githubusercontent.com/u/30194876?v=4","gravatar_id":"","url":"https://api.github.com/users/flolilo","html_url":"https://github.com/flolilo","followers_url":"https://api.github.com/users/flolilo/followers","following_url":"https://api.github.com/users/flolilo/following{/other_user}","gists_url":"https://api.github.com/users/flolilo/gists{/gist_id}","starred_url":"https://api.github.com/users/flolilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flolilo/subscriptions","organizations_url":"https://api.github.com/users/flolilo/orgs","repos_url":"https://api.github.com/users/flolilo/repos","events_url":"https://api.github.com/users/flolilo/events{/privacy}","received_events_url":"https://api.github.com/users/flolilo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-17T17:55:03Z","updated_at":"2017-09-18T22:51:51Z","closed_at":null,"author_association":"NONE","body":"**Do you want to request a *feature* or report a *bug*?**\r\nFeature.\r\n\r\n**What is the current behavior?**\r\n`$foobar | Start-RSJob -Name \"XYZ\" -ScriptBlock {$_ = $_ + 1} | | Wait-RSJob -ShowProgress`\r\nwill show a progress-bar similarly to\r\n`Write-Progress -Activity \"RSJobs Tracker\" -Status \"Remaining Jobs: $($_.Length - $current_RSJob_index)\" -Percentcomplete (($_.Length * 100) / $current_RSJob_index)`. The progress-bar will stay on the console after completion.\r\n\r\n**What is the expected behavior?**\r\n- `Wait-RSJob -ShowProgress` should, _in my opinion_, remove the progress-bar after finishing: just like the `Write-Progress`' `-Completed`-switch (Which must be called additionally after completion).\r\n- `Wait-RSJob -ShowProgress` should, _in my opinion_, output the name of the RSJob(s) it is waiting for (or provide an option for it).\r\n\r\n**Which versions of Powershell and which OS are affected by this ~~issue~~? ~~Did this work in previous versions of our scripts?~~**\r\nWin10 (1703) x64, PowerShell v5.1\r\n\r\n**Please provide a code example showing the issue, if applicable:**\r\n```PowerShell\r\n[int]$ThreadCount = 4\r\n[array]$Files_In = Get-ChildItem -Path .\\ -File | ForEach-Object {\r\n    [PSCustomObject]@{\r\n        FullName = $_.FullName\r\n        Hash = $null\r\n    }\r\n}\r\nwhile($true){\r\n    foreach($i in $Files_In.FullName){\r\n        Write-Output $i\r\n    }\r\n    $Files_In | Start-RSJob -Name \"GetHash\" -Throttle $ThreadCount -ScriptBlock {\r\n        $_.Hash = Get-FileHash -LiteralPath $_.FullName -Algorithm SHA1 | Select-Object -ExpandProperty Hash\r\n    } | Wait-RSJob -ShowProgress | Receive-RSJob\r\n\r\n    foreach($i in $Files_In.Hash){\r\n        Write-Output $i\r\n    }\r\n    Start-Sleep -Seconds 1\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/proxb/PoshRSJob/issues/comments/330378356","html_url":"https://github.com/proxb/PoshRSJob/issues/165#issuecomment-330378356","issue_url":"https://api.github.com/repos/proxb/PoshRSJob/issues/165","id":330378356,"user":{"login":"flolilo","id":30194876,"avatar_url":"https://avatars0.githubusercontent.com/u/30194876?v=4","gravatar_id":"","url":"https://api.github.com/users/flolilo","html_url":"https://github.com/flolilo","followers_url":"https://api.github.com/users/flolilo/followers","following_url":"https://api.github.com/users/flolilo/following{/other_user}","gists_url":"https://api.github.com/users/flolilo/gists{/gist_id}","starred_url":"https://api.github.com/users/flolilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flolilo/subscriptions","organizations_url":"https://api.github.com/users/flolilo/orgs","repos_url":"https://api.github.com/users/flolilo/repos","events_url":"https://api.github.com/users/flolilo/events{/privacy}","received_events_url":"https://api.github.com/users/flolilo/received_events","type":"User","site_admin":false},"created_at":"2017-09-18T22:51:51Z","updated_at":"2017-09-18T22:51:51Z","author_association":"NONE","body":"For me, the behavior is quite inconsitent - with the above script, most of the time, the progress-bar will vanish, but especially in larger scripts, they tend to stick somewhere in the upper lines of the console.\r\n\r\n![grafik](https://user-images.githubusercontent.com/30194876/30568074-9ff38948-9cd3-11e7-9b78-06e57fc23c32.png) Here is a quick example. I don't even understand how it got that \"glitchy\".\r\n\r\nConcerning the names: I can understand that and I admit that this is no big issue at all. However, it would be nice if one could state what the script is waiting for. With all the progress-bar-debris it's quite easy to get confused which Wait-RSJob-\"iteration\" is waiting at the moment, which makes troubleshooting...well, not impossible but just a tad more difficult. ;-)\r\nBut again, I suppose there are more pressing concerns than an unnamed progress-bar. ;-)"}}
{"actor":{"display_login":"flolilo"}}