Closed paulbouwer closed 9 years ago
The current method of removing a version in the PowerShell is a little too keen and removes the target folder in addition to the junction. This is due to the use of the following:
PowerShell
Remove-Item $versionToRemove.Location -Force -Recurse
This needs to be replaced with a check to see if the directory for the version is a junction. This can be achieved with:
[System.IO.File]::GetAttributes($path)
If the attributes include the following Directory, ReparsePoint, then it is a junction. The junction can be deleted as follows:
Directory, ReparsePoint
[System.IO.Directory]::Delete($path, $false)
:+1: hit me today :wink:
The current method of removing a version in the
PowerShell
is a little too keen and removes the target folder in addition to the junction. This is due to the use of the following:This needs to be replaced with a check to see if the directory for the version is a junction. This can be achieved with:
If the attributes include the following
Directory, ReparsePoint
, then it is a junction. The junction can be deleted as follows: