Skip to content

Fix Set-Location to only use filesystem directory (if exists) only if using FileSystem provider - #6654

Closed
Steve Lee (SteveL-MSFT) wants to merge 2 commits into
PowerShell:masterfrom
SteveL-MSFT:location-globber
Closed

Steve Lee (SteveL-MSFT) wants to merge 2 commits into
PowerShell:masterfrom
SteveL-MSFT:location-globber

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Apr 14, 2018 •

Copy link
Copy Markdown
Member

PR Summary

While working on getting the Cert provider working on non-Windows. I noticed that a fix I added
previously made the assumption that it was being used only by the FileSystem provider. Fix is to
add check that it is being used by FileSystem provider before checking if the directory exists
on the file system.

PR Checklist

@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title WIP: Only return directory if using FileSystem provider Fix Set-Location to only use filesystem directory (if exists) only if using FileSystem provider Apr 29, 2018
@iSazonov

Copy link
Copy Markdown
Collaborator

I noticed that a fix I added previously made the assumption

What is the PR? Please add a link in the PR description.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) added link to previous PR in description

@iSazonov

Ilya (iSazonov) commented Apr 30, 2018 •

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Thanks! Maybe we need use

Context.SessionState.Path.GetUnresolvedProviderPathFromPSPath(path);

to be provider aware? We use this for -LiteralPath.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) not sure I understand how to apply that to this issue. In this case, the previous change was to treat a filesystem path as literal if it exists rather than trying to glob. However, it did this regardless of provider, but it was specifically for the filesystem.

@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) I guess the Issue occurs because we have not used right API.
I suggest to consider GetProviderPath(string path, out ProviderInfo provider)

@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Could you continue the PR?

@stale

stale Bot commented Jun 21, 2018

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days.
Thank you for your contributions.
Community members are welcome to grab these works.

@stale stale Bot added the Stale label Jun 21, 2018
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) I'm reverting the original change this PR depends on so this PR is no longer relevant. I'll probably keep the test case and submit it as a separate PR as that is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants