Title: Request: Where-Object used without -Property works on "the object" · Issue #8357 · PowerShell/PowerShell · GitHub
Open Graph Title: Request: Where-Object used without -Property works on "the object" · Issue #8357 · PowerShell/PowerShell
X Title: Request: Where-Object used without -Property works on "the object" · Issue #8357 · PowerShell/PowerShell
Description: These don't work, but it would be nice if they did: PS C:\> 'test.txt', '', 'example.xml' | where -match 'txt' where-object : The specified operator requires both the -Property and -Value parameters. PS C:\> 1..10 | ? -gt $x ?: The speci...
Open Graph Description: These don't work, but it would be nice if they did: PS C:\> 'test.txt', '', 'example.xml' | where -match 'txt' where-object : The specified operator requires both the -Property and -Value parameter...
X Description: These don't work, but it would be nice if they did: PS C:\> 'test.txt', '', 'example.xml' | where -match 'txt' where-object : The specified operator requires ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/8357
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Request: Where-Object used without -Property works on \"the object\"","articleBody":"These don't work, but it would be nice if they did:\r\n\r\n PS C:\\\u003e 'test.txt', '', 'example.xml' | where -match 'txt'\r\n where-object : The specified operator requires both the -Property and -Value parameters.\r\n\r\n PS C:\\\u003e 1..10 | ? -gt $x\r\n ?: The specified operator requires both the -Property and -Value parameters.\r\n\r\nbut integers and strings have no -Property way to access their values. Select-String helps for text, but outputs MatchInfo not String. And doesn't help for any of the operators except -match.\r\n\r\nUsed without -Property it could implicitly use `$_` with whatever casting that implies, the same as if you'd written `{ $_ -operator 'value' }` as the filterscript.\r\n\r\nAnd then you could do:\r\n\r\n PS C:\\\u003e 'test.txt', '', 'example.xml' | ? | foreach { .. }\r\n\r\nand that would implicitly act like `? { $_ }` which does a boolean cast on the object and passes true ones.","author":{"url":"https://github.com/HumanEquivalentUnit","@type":"Person","name":"HumanEquivalentUnit"},"datePublished":"2018-11-29T05:25:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":28},"url":"https://github.com/8357/PowerShell/issues/8357"}
| 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:ff68ec1e-5850-7633-7a8e-0585bb9e40d4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD5A:1971A3:1566CB8:1F3D8CC:6A4E4A48 |
| html-safe-nonce | 033f80501221e667631ecf47a8102a295f0c8d07a45d2fb11a4bf4a8f4fcefba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDVBOjE5NzFBMzoxNTY2Q0I4OjFGM0Q4Q0M6NkE0RTRBNDgiLCJ2aXNpdG9yX2lkIjoiNjU1ODc5MDA4NjQzNDkwMDU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a8af9d27eb42eb79271cbc5b6dd075d3655f7733bc150e85bd29a6ac3b36cc43 |
| hovercard-subject-tag | issue:385575384 |
| 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/8357/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f4ce470e23f41dc8d539e8a4f387951cf40a8b80c7ae0ae59417a01d8dc33852/PowerShell/PowerShell/issues/8357 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f4ce470e23f41dc8d539e8a4f387951cf40a8b80c7ae0ae59417a01d8dc33852/PowerShell/PowerShell/issues/8357 |
| og:image:alt | These don't work, but it would be nice if they did: PS C:\> 'test.txt', '', 'example.xml' | where -match 'txt' where-object : The specified operator requires both the -Property and -Value parameter... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | HumanEquivalentUnit |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| 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 | e8506f6d0538364886e3f0153c154c410965e70d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width