Title: Select-String breaks when used with ForEach-Object -Parallel and Start-ThreadJob · Issue #11242 · PowerShell/PowerShell · GitHub
Open Graph Title: Select-String breaks when used with ForEach-Object -Parallel and Start-ThreadJob · Issue #11242 · PowerShell/PowerShell
X Title: Select-String breaks when used with ForEach-Object -Parallel and Start-ThreadJob · Issue #11242 · PowerShell/PowerShell
Description: jszabo98 discovered the Start-ThreadJob problem in #11092; it affects ForEach-Object -Parallel as well Unlike #11092, it doesn't seem to be related to output formatting data per se, but to the VT escape sequences created to highlight the...
Open Graph Description: jszabo98 discovered the Start-ThreadJob problem in #11092; it affects ForEach-Object -Parallel as well Unlike #11092, it doesn't seem to be related to output formatting data per se, but to the VT e...
X Description: jszabo98 discovered the Start-ThreadJob problem in #11092; it affects ForEach-Object -Parallel as well Unlike #11092, it doesn't seem to be related to output formatting data per se, but to the ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/11242
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Select-String breaks when used with ForEach-Object -Parallel and Start-ThreadJob","articleBody":"@jszabo98 discovered the `Start-ThreadJob` problem in #11092; it affects `ForEach-Object -Parallel` as well\r\n\r\nUnlike #11092, it doesn't seem to be related to output formatting data per se, but to the VT escape sequences created to highlight the matching part of a line, given that the problem goes away when you add `-NoEmphasis` - even though the tests use `-Raw` for direct `[string]` output, in which case `-NoEmphasis` should have no effect, given that `-Raw` doesn't perform highlighting.\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\n# Adding -NoEmphasis to Select-String makes the problem go away.\r\nStart-ThreadJob { 'hi' | Select-String hi -Raw } | Receive-Job -Wait -AutoRemoveJob | Should -be hi\r\n'hi' | ForEach-Object -parallel { $_ | Select-String hi -Raw } | Should -Be hi\r\n```\r\n\r\n# Expected behavior\r\n\r\nBoth tests should pass.\r\n\r\n# Actual behavior\r\n\r\nBoth tests emit an error message and fail:\r\n\r\n```none\r\nSelect-String: Object reference not set to an instance of an object.\r\n...\r\n ^ Expected 'hi', but got $null.\r\n```\r\n\r\n# Environment data\r\n\r\n```none\r\nPowerShell Core 7.0.0-preview.6\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2019-12-03T16:38:48Z","url":"https://github.com/PowerShell/PowerShell/issues/11242"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:db4d1478-e3b0-baa5-b39b-6ef9fce4b99b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE4E:23EA3F:1789F1:202C9D:6AFD4E5C |
| html-safe-nonce | befcdae1e251d1d39b250c61347dd2d4d9fae942fe31d8c9fced1e09468ef63c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTRFOjIzRUEzRjoxNzg5RjE6MjAyQzlEOjZBRkQ0RTVDIiwidmlzaXRvcl9pZCI6IjMyNzUyODgwNjExMDA3NzI5NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bc4d526b8cdea360fa9c88e727b307e7c8812ab0b6d8f74f23e811a5405c6229 |
| hovercard-subject-tag | issue:532114091 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/11242/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8aabf4636f2d661326b0d919ca28f710ccc029a173a1730de449213eb2175c79/PowerShell/PowerShell/issues/11242 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8aabf4636f2d661326b0d919ca28f710ccc029a173a1730de449213eb2175c79/PowerShell/PowerShell/issues/11242 |
| og:image:alt | jszabo98 discovered the Start-ThreadJob problem in #11092; it affects ForEach-Object -Parallel as well Unlike #11092, it doesn't seem to be related to output formatting data per se, but to the VT e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width