Title: Select-Object -ExpandProperty and -Property should be mutually exclusive · Issue #6161 · PowerShell/PowerShell · GitHub
Open Graph Title: Select-Object -ExpandProperty and -Property should be mutually exclusive · Issue #6161 · PowerShell/PowerShell
X Title: Select-Object -ExpandProperty and -Property should be mutually exclusive · Issue #6161 · PowerShell/PowerShell
Description: [Closed, because it is based on a misconception of how -ExpandProperty works.] -ExpandProperty makes Select-Object return a single property value, which is mutually exclusive with -Property, which outputs a custom object with the specifi...
Open Graph Description: [Closed, because it is based on a misconception of how -ExpandProperty works.] -ExpandProperty makes Select-Object return a single property value, which is mutually exclusive with -Property, which ...
X Description: [Closed, because it is based on a misconception of how -ExpandProperty works.] -ExpandProperty makes Select-Object return a single property value, which is mutually exclusive with -Property, which ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/6161
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Select-Object -ExpandProperty and -Property should be mutually exclusive","articleBody":"[Closed, because it is based on a misconception of how `-ExpandProperty` works.]\r\n\r\n`-ExpandProperty` makes `Select-Object` return a single property _value_, which is mutually exclusive with `-Property`, which outputs a _custom object_ with the specified properties.\r\n\r\nCurrently, `-Property` is quietly ignored when `-ExpandProperty` is also specified.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n[pscustomobject] @{ one = 1; two = 2; three = 3 } | \r\n Select-Object -ExpandProperty one -Property three\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\nA statement-terminating error complaining about mutually exclusive parameters should be issued.\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\n1\r\n```\r\n\r\nThat is, the `-Property` argument was silently _ignored_.\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nPowerShell Core v6.0.1\r\nWindows PowerShell v5.1\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2018-02-15T14:54:11Z","url":"https://github.com/PowerShell/PowerShell/issues/6161"}
| 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:d8b81753-1455-c521-e983-52359ef2b0d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80F2:3AC570:BDE5F:10873C:6AFD5ADA |
| html-safe-nonce | a4c59e8b477206288e1dbaa529ce8edbbb5d7ba96d4ba4cf98416cbc6ca0ecc3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEYyOjNBQzU3MDpCREU1RjoxMDg3M0M6NkFGRDVBREEiLCJ2aXNpdG9yX2lkIjoiMTczNDc0NzgxMTAyNDI5NjY2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cbd23404a82451fc798dbf20ab5fa3e737922445b868c9011cf1648d487f92bd |
| hovercard-subject-tag | issue:297474045 |
| 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/6161/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7533b771ab99c926d39fdc43660d80a7fc3115582de00d27dfc36b6c3257ef00/PowerShell/PowerShell/issues/6161 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7533b771ab99c926d39fdc43660d80a7fc3115582de00d27dfc36b6c3257ef00/PowerShell/PowerShell/issues/6161 |
| og:image:alt | [Closed, because it is based on a misconception of how -ExpandProperty works.] -ExpandProperty makes Select-Object return a single property value, which is mutually exclusive with -Property, which ... |
| 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