Skip to content

New-Item -ItemType SymbolicLink folder cannot be opened #2915

@yanxyz

Description

@yanxyz

Use the lastest PowerShell to create a symbolic link folder:

New-Item -ItemType Directory .\a
New-Item .\a\t.txt -Value "hello"
New-Item -ItemType SymbolicLink -Name .\d  -Value .\a
# The Mode property is empty in the result of above cmdlet
Get-ItemPropertyValue .\d -Name Mode
# Get-ItemPropertyValue : Exception getting "Mode": "句柄无效。"
# My OS language is Chinese, "句柄无效" means "invalid handler"

The big problem is that the symbolic link d created above can't be opened. When using the system default PowerShell(PowerShell 5.1, My OS is Windows 10 x64) to create a symbolic link folder, it works well. Another question, now use the lastest PowerShell to remove the symbolic link that is created by the system default PowerShell

> Remove-Item .\d -Recurse
# Remove-Item : F:\test\test-powershell\Symlink\d is an NTFS junction point. Use the Force parameter to delete or modify this object.

It says "d is an NTFS junction point", well, d is a symbolic link,isn't it?

> $PSVersionTable
Name                           Value
----                           -----
SerializationVersion           1.1.0.1
BuildVersion                   3.0.0.0
WSManStackVersion              3.0
GitCommitId                    v6.0.0-alpha.14
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
CLRVersion
PSRemotingProtocolVersion      2.3
PSVersion                      6.0.0-alpha

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions