Skip to content

New-Item -ItemType SymbolicLink cannot understand directory path ending with slash on Linux #2865

Closed

Description

Steps to reproduce

New-Item -ItemType SymbolicLink -Path /foo/ -Value /bar/

Expected behavior

Symbolic link is created from /foo/ to /bar/.

Actual behavior

New-Item : No such file or directory

Removing the slash at the end of the Path argument makes the call behave as expected. This is counterintuitive, as a slash at the end of a path generally works fine in PowerShell scripts to designate directories (and directory links).

Environment data

Running PowerShell on Ubuntu 16.04.

> $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.12
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Activity

  1. added this to the milestone on Dec 9, 2016
  2. chunqingchen commented on Apr 18, 2017

    @chunqingchen
    Contributor

    this issue has been resolved
    #2974

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugIssue has been identified as a bug in the productOS-LinuxWG-Cmdletsgeneral cmdlet issues

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions