Filesystem Provider, UNC Paths & Double Backslash
See original GitHub issueSteps to reproduce
Run Remove-Item with a UNC path that contains a doubled backslash before the last item and including -WhatIf.
After confirming that you want to delete multiple items even though you didn’t specify recurse, check the path it would have deleted.
Remove-Item \\localhost\C$\temp\\ADMF -WhatIf
Expected behavior
What if: Performing the operation "Remove Directory" on target "\\localhost\C$\temp\ADMF"
Actual behavior
What if: Performing the operation "Remove Directory" on target "\\localhost\C$\temp\"
Environment data
Name Value
---- -----
PSVersion 7.1.0-preview.6
PSEdition Core
GitCommitId 7.1.0-preview.6
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
What is the difference between \ and \\ in file path
The only exception is double-backslash at the very beginning of a path that indicates a UNC path. See Universal Naming Convention.
Read more >UNC path lost with Path constructor - Python discussion
constructor (while in other locations they are consolidated. But on windows (where the double slash indicates a UNC path), this is lost.
Read more >Language: Handling file paths on Windows
When using backslashes in a double-quoted string, you must always use two backslashes for each literal backslash. There are no exceptions and no...
Read more >What do two backward slashes in file path mean?
1 Answer. File paths shown with 2 backslashes are for network shares. For example \\192.168. 0.2\MyShareFolder or \\MyNAS\MyShareFolder .
Read more >Python 3 Quick Tip: The easy way to deal with file paths ...
To use it, you just pass a path or filename into a new Path() object using forward slashes and it handles the rest:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We should consider fixing this for RC.1
Since this is a regression from 5.1 and hitting customers, we should consider backport to 7.2