Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Oct 6, 2018

PR Summary

Get-Content works against a provider (which is currently only supported by filesystemprovider). In the case of dynamic parameters, Get-Content uses globbing to get the appropriate provider to request dynamic parameters. Previously, after globbing it would use the first resolved path to obtain the dynamic parameter and if globbing returned nothing, it would not request the dynamic parameter from the provider. This results in confusing errors to the user reporting that -Raw is not valid, when it is.

The fix is to let the provider decide what to do with the given path when obtaining the dynamic parameters. In the case of the filesystem provider, it doesn't even use the path.

Fix #6954

PR Checklist

@adityapatwardhan adityapatwardhan merged commit 4e5e390 into PowerShell:master Oct 18, 2018
@SteveL-MSFT SteveL-MSFT deleted the get-content-dyn-param branch October 19, 2018 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Get-Content WRONG ERROR MESSAGE when wildcards yield no files

4 participants