Oct 052018
 

Remove-Item cannot be used to remove symbolic link to directory as it will remove the content of the directory it points to (so be careful!).

To safely remove a symbolic link from the file system using PowerShell, add the following function to your script:

From: PowerShell Gallery | Private, LinkUtils

Remove-Symlink -Link [path to the symbolic link you wish to remove]

Done! 🙂

This site uses Akismet to reduce spam. Learn how your comment data is processed.