Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-DcnClone: don't strip trailing slash from root dirs #190

Merged
merged 2 commits into from
May 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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