Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@nightroman

Description

@nightroman
Issue body actions

If a path specified by -LiteralPath does not exist (or is not valid, i.e.
contains forbidden characters) then Get-Item should emit an error.
Currently this does not happen if a path is defined as a wildcard.

The change #4866 fixed this issue for Remove-Item.
The same or similar should be done for Get-Item.

Example:

Given items z.* and [z] do not exist
EDIT: Given item [z] does not exist. As for z.*, it is always "invalid" for LiteralPath.

Get-Item -LiteralPath z.*
Get-Item -LiteralPath [z]

Expected result:

Get-Item emit errors about not found items.

In fact, an error for z.* may even be different, namely "Illegal characters
in the path" because * or ? are illegal for -LiteralPath and FileSystem.

Actual result:

The above commands silently return nothing.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.