Skip to content

Commit

Permalink
delete junction before creating it again
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Oct 25, 2024
1 parent cfbf237 commit 7180f59
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions functions/helperFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,14 @@ function createSymlink($source, $target){
mkdir "$target" -ErrorAction SilentlyContinue
#
if ($networkInstallation -eq "false"){

if (Test-Path $source) {
$item = Get-Item $source
if ($item.LinkType -eq "Junction") {
Remove-Item -Path $source -Force -Recurse
}
}

New-Item -ItemType Junction -Path "$source" -Target "$target" -ErrorAction SilentlyContinue
} else {

Expand Down

0 comments on commit 7180f59

Please sign in to comment.