-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Leverage new API for creating symlink without administrator privileges on Windows #2845
Copy link
Copy link
Closed
Labels
OS-WindowsResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
Description
Just saw this get posted today: https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/
We should opt-in to this API so that we're uniform across all platforms in allowing non-admins to create links.
Steps to reproduce
Try to create a symlink as a non-admin. You'll get a permission denied.
Expected behavior
(as non-admin)
PS C:\temp> New-Item -type SymbolicLink -Path link -Value source
Directory: C:\temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---l 12/5/2016 6:39 PM 0 linkActual behavior
PS C:\temp> New-Item -type SymbolicLink -Path link -Value source
New-Item : Administrator privilege required for this operation.
At line:1 char:1
+ New-Item -type SymbolicLink -Path link -Value source
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\temp\source:String) [New-Item], UnauthorizedAccessException
+ FullyQualifiedErrorId : NewItemSymbolicLinkElevationRequired,Microsoft.PowerShell.Commands.NewItemCommandEnvironment data
All versions of Windows PowerShell 5.x and PowerShell Core 6.0.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
OS-WindowsResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues