Skip to content

Copy-Item, Move-Item, and Rename-Item cmdlets reject "reserved device names" on Linux #3221

@jeffbi

Description

@jeffbi

On Linux these cmdlets throw an error when attempting to use one of Window's reserved device names (CON, PRN, AUX, etc.) as a target. These names are not reserved on Linux and should not be rejected.

Steps to reproduce

touch afile
Copy-Item afile CON

Expected behavior

File 'afile' is copied to file 'CON'

Actual behavior

copy-item : Cannot process path '/home/jeff/CON' because the target represents a 
reserved device name.
At line:1 char:1
+ copy-item stuff CON
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (/home/jeff/CON:String) [Copy-Item], IOException
    + FullyQualifiedErrorId : CopyError,Microsoft.PowerShell.Commands.CopyItemCommand

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.16-25-ge3b59e0f51fe9619a5def9d469bcf5324b6...
CLRVersion                                                                               
WSManStackVersion              3.0                                                       
PSRemotingProtocolVersion      2.3                                                       
SerializationVersion           1.1.0.1                                                   

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management moduleWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions