Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Move-Item, Remove-Item don't work with paths containing \, [, ] on unix #3414

Copy link
Copy link
@vors

Description

@vors
Issue body actions

Steps to reproduce

On macOS or Linux touch '1\2'
Try mv 1\2 2, try rm 1\2

The real-world example of when you are getting \ without knowing it is https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/11

The problem happens not only with Compress-Archive, but with other archive programs too. So macOS users need a way to bulk-rename files with \ in the name and PS doesn't provide a way to do it at the moment.

UPD: same problem for paths like [foo].

Expected behavior

PowerShell should be able to perform the operations

Actual behavior

Paths are getting normalized to 1/2

rm : Cannot find path '/Users/vors/dev/PowerShell/1/2' because it does not exist.

Environment data

> $PSVersionTable

Name                           Value                                                                                
----                           -----                                                                                
PSVersion                      6.0.0-alpha                                                                          
PSEdition                      Core                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                              
BuildVersion                   3.0.0.0                                                                              
GitCommitId                    v6.0.0-alpha.17                                                                      
CLRVersion                                                                                                          
WSManStackVersion              3.0                                                                                  
PSRemotingProtocolVersion      2.3                                                                                  
SerializationVersion           1.1.0.1                                                                              
Reactions are currently unavailable

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.