Skip to content

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

Closed

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                                                   

Activity

  1. added
    WG-Cmdlets
    WG-Engine-Providers
    and removed
    WG-Cmdlets
    on Mar 3, 2017
  2. added this to the milestone on Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Resolution-FixedWG-CmdletsWG-Engine-Providers

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions