Skip to content

Commit

Permalink
don't strip trailing slash from root dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlydba authored Apr 19, 2022
1 parent f7a98de commit ea9f62e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions functions/clone/New-DcnClone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,12 @@
}
}

# Remove the last "\" from the path it would mess up the mount of the VHD
if ($Destination.EndsWith("\")) {
$Destination = $Destination.Substring(0, $Destination.Length - 1)
}
# If not root dir, remove the last "\" from the path it would mess up the mount of the VHD
if (($Destination | Select-String "\\" -AllMatches).Matches.Count -gt 1) {
if ($Destination.EndsWith("\")) {
$Destination = $Destination.Substring(0, $Destination.Length - 1)
}
}

# Test if the destination can be reached
# Check if computer is local
Expand Down

0 comments on commit ea9f62e

Please sign in to comment.