{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6732","repository_url":"https://api.github.com/repos/PowerShell/PowerShell","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6732/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6732/comments","events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6732/events","html_url":"https://github.com/PowerShell/PowerShell/issues/6732","id":317777413,"number":6732,"title":"Introduce -lp as an alias for -LiteralPath to make it easier to pass literal paths","user":{"login":"mklement0","id":588825,"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":552752480,"url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Area-Cmdlets-Core","name":"Area-Cmdlets-Core","color":"5319e7","default":false},{"id":311043050,"url":"https://api.github.com/repos/PowerShell/PowerShell/labels/Issue-Enhancement","name":"Issue-Enhancement","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-25T20:14:24Z","updated_at":"2018-05-29T15:05:04Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Cmdlets such as `Get-ChildItem` / `Get-Item` bind the first positional argument to the `-Path` parameter.\r\n\r\nThis is convenient on the one hand, because `-Path` supports wildcard expressions, so that you can use commands such as `Get-ChildItem *.txt`\r\n\r\nPassing paths meant to be _literal_ paths that way _typically_ works, given that `*` and `?` aren't permissible characters in actual file names; however, `[` and `]` are, and passing literal paths with such characters causes them to be interpreted as wildcards too, potentially resulting in non-matches (e.g., `Get-Item tmp[0].txt` won't match a file literally named `tmp[0].txt`) and even errors.\r\n\r\n[While _escaping_ wildcard characters is possible, it is tricky and cumbersome](https://github.com/PowerShell/PowerShell/issues/6714#issuecomment-384353966), which is the primary reason that the `-LiteralPath` parameter was introduced.\r\n\r\nGiven how common it is to pass literal paths, it would be convenient to be able to shorten:\r\n\r\n```powershell\r\nGet-Item -LiteralPath tmp[0].txt\r\n```\r\n\r\nto:\r\n\r\n```powershell\r\nGet-Item -lp tmp[0].txt  # wishful thinking\r\n```\r\n\r\nNote that while using _elastic syntax_ does work - `-l` is currently enough to uniquely identify `-LiteralPath` with `Get-Item` for instance - it is not future-proof (and should never be used in scripts), whereas having an immutable, official parameter-name _alias_ is.\r\n\r\nGranted, in scripts it's preferable to use the verbose, original names of parameter names (and to prefer named arguments over positional ones and to never rely on elastic syntax), but given how common it is to pass literal paths, `-lp` is still a desirable convenience, both on the command line and in scripts.\r\n\r\nEnvironment data\r\n----------------\r\n\r\nWritten as of:\r\n\r\n```powershell\r\nPowerShell Core v6.0.2\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments/392811090","html_url":"https://github.com/PowerShell/PowerShell/issues/6732#issuecomment-392811090","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/6732","id":392811090,"user":{"login":"kvprasoon","id":12897753,"avatar_url":"https://avatars1.githubusercontent.com/u/12897753?v=4","gravatar_id":"","url":"https://api.github.com/users/kvprasoon","html_url":"https://github.com/kvprasoon","followers_url":"https://api.github.com/users/kvprasoon/followers","following_url":"https://api.github.com/users/kvprasoon/following{/other_user}","gists_url":"https://api.github.com/users/kvprasoon/gists{/gist_id}","starred_url":"https://api.github.com/users/kvprasoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvprasoon/subscriptions","organizations_url":"https://api.github.com/users/kvprasoon/orgs","repos_url":"https://api.github.com/users/kvprasoon/repos","events_url":"https://api.github.com/users/kvprasoon/events{/privacy}","received_events_url":"https://api.github.com/users/kvprasoon/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T15:05:04Z","updated_at":"2018-05-29T15:05:04Z","author_association":"CONTRIBUTOR","body":"@TravisEz13  This issue can be closed as this is implemented via #6770"}}
{"actor":{"display_login":"kvprasoon"}}