-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
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.
Milestone
Description
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.
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.