We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 66daecd + 0b57d8e commit 0148b66Copy full SHA for 0148b66
functions/clone/New-DcnClone.ps1
@@ -274,10 +274,12 @@
274
}
275
276
277
- # Remove the last "\" from the path it would mess up the mount of the VHD
278
- if ($Destination.EndsWith("\")) {
279
- $Destination = $Destination.Substring(0, $Destination.Length - 1)
280
- }
+ # 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)
281
+ }
282
283
284
# Test if the destination can be reached
285
# Check if computer is local
0 commit comments