PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

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

Open jeffbi opened this issue 9 years ago • 0 comments

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                                                   

jeffbi avatar Feb 27 '17 22:02 jeffbi