{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5699","repository_url":"https://api.github.com/repos/PowerShell/PowerShell","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5699/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5699/comments","events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5699/events","html_url":"https://github.com/PowerShell/PowerShell/issues/5699","id":282506415,"node_id":"MDU6SXNzdWUyODI1MDY0MTU=","number":5699,"title":"Get-ChildItem -Recurse treats literals passed to -Path like wildcard expressions","user":{"login":"mklement0","id":588825,"node_id":"MDQ6VXNlcjU4ODgyNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/588825?v=4","gravatar_id":"","url":"https://api.github.com/users/mklement0","html_url":"https://github.com/mklement0","followers_url":"https://api.github.com/users/mklement0/followers","following_url":"https://api.github.com/users/mklement0/following{/other_user}","gists_url":"https://api.github.com/users/mklement0/gists{/gist_id}","starred_url":"https://api.github.com/users/mklement0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mklement0/subscriptions","organizations_url":"https://api.github.com/users/mklement0/orgs","repos_url":"https://api.github.com/users/mklement0/repos","events_url":"https://api.github.com/users/mklement0/events{/privacy}","received_events_url":"https://api.github.com/users/mklement0/received_events","type":"User","site_admin":false},"labels":[{"id":552752833,"node_id":"MDU6TGFiZWw1NTI3NTI4MzM=","url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Area-Providers","name":"Area-Providers","color":"5319e7","default":false},{"id":474781609,"node_id":"MDU6TGFiZWw0NzQ3ODE2MDk=","url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Breaking-Change","name":"Breaking-Change","color":"b60205","default":false},{"id":483158128,"node_id":"MDU6TGFiZWw0ODMxNTgxMjg=","url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Committee-Reviewed","name":"Committee-Reviewed","color":"0e5a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-12-15T18:11:17Z","updated_at":"2018-08-09T19:28:22Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The 1st positional argument passed to `Get-ChildItem` binds to `-Path`, meaning that wildcard expressions _are_ supported.\r\n\r\nHowever, values that are _literal_ paths - values that do not contain wildcard metacharacters such as `*` - should be treated as such.\r\n\r\n* _Without_ `-Recurse`, that is already the case: A nonexistent literal path triggers an error.\r\n\r\n* _With_ `-Recurse`:\r\n\r\n   * The nonexistent path (assuming that it is a mere filename or its parent path exists) is treated like a wildcard expression that happens to match nothing.\r\n   * Additionally, this matching is apparently performed in _all_ the directories in the subtree.\r\n\r\nWorkaround (and generally the better choice if you know a path to be a literal one):  \r\n`Get-ChildItem -Recurse -LiteralPath <path>`\r\n\r\n_Update_: `Get-ChildItem -Recurse <name>` may also yield _false positives_, by matching `<name>` _anywhere in the subtree_ rather than just in the current location - see below.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\nGet-ChildItem NoSuch\r\nGet-ChildItem NoSuch -Recurse\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\nBoth commands should report an error re nonexistent item `NoSuch`.\r\n\r\nActual behavior\r\n---------------\r\n\r\n`Get-ChildItem NoSuch -Recurse` produces no output at all (neither success nor error), and `$?` is set to `$True`.\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\n﻿PowerShell Core v6.0.0-rc.2 (v6.0.0-rc.2) on Microsoft Windows 7 Enterprise  (64-bit; v6.1.7601)\r\nWindows PowerShell v5.1.14409.1012 on Microsoft Windows 7 Enterprise  (64-bit; v6.1.7601)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments/411869907","html_url":"https://github.com/PowerShell/PowerShell/issues/5699#issuecomment-411869907","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/5699","id":411869907,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTg2OTkwNw==","user":{"login":"mi-hol","id":22799428,"node_id":"MDQ6VXNlcjIyNzk5NDI4","avatar_url":"https://avatars2.githubusercontent.com/u/22799428?v=4","gravatar_id":"","url":"https://api.github.com/users/mi-hol","html_url":"https://github.com/mi-hol","followers_url":"https://api.github.com/users/mi-hol/followers","following_url":"https://api.github.com/users/mi-hol/following{/other_user}","gists_url":"https://api.github.com/users/mi-hol/gists{/gist_id}","starred_url":"https://api.github.com/users/mi-hol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mi-hol/subscriptions","organizations_url":"https://api.github.com/users/mi-hol/orgs","repos_url":"https://api.github.com/users/mi-hol/repos","events_url":"https://api.github.com/users/mi-hol/events{/privacy}","received_events_url":"https://api.github.com/users/mi-hol/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T19:28:22Z","updated_at":"2018-08-09T19:28:22Z","author_association":"NONE","body":"A really dangerous bug open for an eternity :(\r\nIs it so hard to fix?\r\nWould a headline like 'PowerShell killed all my data' be good marketing?"}}
{"actor":{"display_login":"mi-hol"}}