Skip to content

New-Item: -ItemType Junction is mistakenly accepted on non-NTFS file-systems and appears to be a quiet no-op #27252

@mklement0

Description

@mklement0

Prerequisites

Steps to reproduce

Junctions are an NTFS-specific feature, so trying to create them on other file-systems should result in an error.

# On a Unix-like platform / non-NTFS file-system
New-Item foo -Target $HOME -type Junction

Expected behavior

A (statement-terminating) error should occur.

Actual behavior

The item type is quietly accepted and no discernible action is performed: no output, no creation of an item named foo.

Note: If there's a preexisting foo item, a confusing error about (the expanded value of) $HOME/foo not being a directory is emitted.

Error details

Environment data

PowerShell 7.6.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions