question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filesystem Provider, UNC Paths & Double Backslash

See original GitHub issue

Steps 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:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rjmholtcommented, Sep 16, 2020

We should consider fixing this for RC.1

1reaction
SteveL-MSFTcommented, Jan 23, 2023

Since this is a regression from 5.1 and hitting customers, we should consider backport to 7.2

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found