You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PowerShell 7 is unable to create a junction on relative paths while PS 5 can #15750
Finally found the problem. PowerShell 7 can't work with relative paths when creating junctions on directories. However PS5 can. So to fix it, you must provide always a full path. So with a full path works with PS 5 and PS 7, and you can use Target or Value both work.
Either way it works now. Remember to run powershell as admin which can be required:
changed the title [-]PowerShell 7 is unable to create a junction while PS 5 can[/-][+]PowerShell 7 is unable to create a junction on relative paths while PS 5 can[/+]on Jul 11, 2021
I think you are running into an issue where relative symlink paths are relative to the process's (not the PS file system provider's) current working dir. See #15235 (comment)
Activity
237dmitry commentedon Jul 10, 2021
I think you confused the
Pathwith theTargetsuperbonaci commentedon Jul 11, 2021
237dmitry no I didn't, because the folder
C:\Program Files (x86)\Steamwas moved to another drive.Similar bug: #6232
superbonaci commentedon Jul 11, 2021
Finally found the problem. PowerShell 7 can't work with relative paths when creating junctions on directories. However PS5 can. So to fix it, you must provide always a full path. So with a full path works with PS 5 and PS 7, and you can use
TargetorValueboth work.Either way it works now. Remember to run powershell as admin which can be required:
[-]PowerShell 7 is unable to create a junction while PS 5 can[/-][+]PowerShell 7 is unable to create a junction on relative paths while PS 5 can[/+]rkeithhill commentedon Jul 11, 2021
I think you are running into an issue where relative symlink paths are relative to the process's (not the PS file system provider's) current working dir. See #15235 (comment)
superbonaci commentedon Jul 11, 2021
Yeah but something changed too much if works with PS5 and not with PS7. This is kind of incompatibility thing which shouldn't happen I guess...
rkeithhill commentedon Jul 11, 2021
Agreed but unfortunately regressions happen, and often when someone has the good intention of fixing some bug or implementing an enhancement request.
superbonaci commentedon Jul 11, 2021
Yeah the idea if that's a regression or done on purpose.