Skip to content

IsReservedDeviceName does not recognize CONIN$, CONOUT$ #13046

@KalleOlaviNiemitalo

Description

@KalleOlaviNiemitalo

Steps to reproduce

"hello" > world
Move-Item world CONOUT$

Expected behavior

Move-Item: Cannot process path 'C:\Temp\u\CONOUT$' because the target represents a reserved device name.

Actual behavior

Move-Item outputs hello to the console. After that, neither world nor CONOUT$ exists as a file in the directory.

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.2
PSEdition                      Core
GitCommitId                    7.0.2
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Notes

string[] reservedDeviceNames = { "CON", "PRN", "AUX", "CLOCK$", "NUL",
"COM0", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
"LPT0", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" };

That also lists CLOCK$, COM0, and LPT0 even though those names are not reserved in Win32. IIRC, MS-DOS has a CLOCK$ or CONFIG$ device.

Metadata

Metadata

Assignees

No one assigned

    Labels

    First-Time-IssueEasy issues first time contributors can work on to learn about this projectIssue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions