Skip to content

Commit

Permalink
Merge pull request #190 from lowlydba/patch-5
Browse files Browse the repository at this point in the history
New-DcnClone: don't strip trailing slash from root dirs
  • Loading branch information
sanderstad authored May 4, 2022
2 parents 66daecd + 0b57d8e commit 0148b66
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, else 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 0148b66

Please sign in to comment.