Skip to content

Support passing PSPath to native commands - #12386

Merged
Andrew (anmenaga) merged 13 commits into
PowerShell:masterfrom
SteveL-MSFT:psdrive-native
Apr 27, 2020
Merged

Andrew (anmenaga) merged 13 commits into
PowerShell:masterfrom
SteveL-MSFT:psdrive-native

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Apr 20, 2020 •

Copy link
Copy Markdown
Member

PR Summary

Add a new PSNativePSPathResolution Experimental Feature where if a PSDrive is passed to a native command and uses the FileSystem provider, then the resolved file path is passed to the native command. This means something like:

code temp:/test.txt

now works as expected. Also, on Windows, if the path starts with ~, then that will get resolved before passing to a native command. In both cases, the path is normalized to the directory separators for the relevant operating system. Note:

  • if the path is not a psdrive nor ~ (on Windows), then path normalization doesn't occur
  • if the path is in single quotes, then it's not resolved and treated as literal

PR Context

Fix #10675
Fix #11386

PR Checklist

@SteveL-MSFT Steve Lee (SteveL-MSFT) added the CL-Experimental Indicates that a PR should be marked as an Experimental Feature in the Change Log label Apr 20, 2020
change string comparison to use string static methods
…Binder.cs

Co-Authored-By: Ilya <darpa@yandex.ru>
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) retry macos

@PoshChan

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-macOS

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) retry windows

@PoshChan

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-Windows

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Apr 24, 2020
…case for relative pspath, add test case for complex psdrive name
…bing API returns z:\ for just z: which is not correct
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry windows

@PoshChan

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-Windows

@anmenaga

Copy link
Copy Markdown

Added doc issue: MicrosoftDocs/PowerShell-Docs#5848

@anmenaga
Andrew (anmenaga) merged commit 23b1dd4 into PowerShell:master Apr 27, 2020
@iSazonov Ilya (iSazonov) removed the Documentation Needed in this repo Documentation is needed in this repo label Apr 28, 2020
@iSazonov Ilya (iSazonov) added this to the 7.1.0-preview.3 milestone Apr 28, 2020
@ghost

Copy link
Copy Markdown

🎉v7.1.0-preview.3 has been released which incorporates this pull request.:tada:

Handy links:

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

Labels

CL-Experimental Indicates that a PR should be marked as an Experimental Feature in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emulation of ~ (tilde) expansion for native utilities is incomplete Resolve file paths before passing to native commands

5 participants