Skip to content

fix get-item -literalpath a*b if a*b doesn't actually exist to return error - #5197

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:get-literalpath
Oct 26, 2017
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:get-literalpath

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

Previously, -literalpath given a wildcard will treat it the same as -path and if the wildcard found no files, it would silently exit. Correct behavior should be that -literalpath is literal so if the file doesn't exist, it should error. Fix is to also see if wildcard is being suppressed.

Also re-enabled and fixed some tests that were skipped incorrectly (should have been pending) since the issue was addressed.

Fix #5057

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 7407a9e into PowerShell:master Oct 26, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the get-literalpath branch October 26, 2017 22:35
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get-Item -LiteralPath with FileSystem should fail on paths with wildcards

2 participants