NTFSSecurity icon indicating copy to clipboard operation
NTFSSecurity copied to clipboard

Remove-Item2 unable to remove Junction

Open Skons opened this issue 7 years ago • 1 comments

When you try to remove a junction, the following error is returned

remove-item2 : (87) The parameter is incorrect: [\\?\D:\testjunction]
At line:1 char:1
+ remove-item2 -Path .\testjunction\
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (.\testjunction\:String) [Remove-Item2], IOException
    + FullyQualifiedErrorId : DeleteError,NTFSSecurity.RemoveItem2

image

Skons avatar Jan 11 '19 09:01 Skons

Thanks for reporting this. However I am unable to repro it. What OS / PowerShell version do you use?

PS D:\Test> New-Item -Name Juntion1 -Value .\Folder1\ -ItemType Junction


    Directory: D:\Test


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d----l         4/3/2019   1:18 PM                Juntion1


PS D:\Test> dir


    Directory: D:\Test


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         4/3/2019   1:18 PM                Folder1
d----l         4/3/2019   1:18 PM                Juntion1

PS D:\Test> Remove-Item2 -Path .\Juntion1\
PS D:\Test> dir


    Directory: D:\Test


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         4/3/2019   1:18 PM                Folder1

raandree avatar Apr 03 '19 11:04 raandree