I am trying to create a symlink to a file on Windows using PowerShell. I am using the New-Symlink
cmdlet from the PowerShell Community Extensions.
After struggling to figure out the syntax of New-Symlink
I was able to get it to work correctly on my local drive. However, I am trying to get it to work on a file share and when I run the command there, I get this output
[PC-KHARPER] <~>$ New-Symlink '\\nyprodfs01\profiles$\kharper\testDir\testFile2' '\\nyprodfs01\profiles$\kharper\testFile'
New-Symlink : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At line:1 char:1
+ New-Symlink '\\nyprodfs01\profiles$\kharper\testDir\testFile2' '\\nyprodfs01\pro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Microsoft.Power...stDir\testFile2:UnresolvedPscxPathImpl) [New-Symlink], Unauthoriz
edAccessException
+ FullyQualifiedErrorId : CreateSymbolicLinkError,Pscx.Commands.IO.Ntfs.NewSymlinkCommand
Is this expected output for UNC paths? Or should it be working and I'm just doing something wrong?