Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ private static string GetCorrectCasedPath(string path)
else if (string.IsNullOrEmpty(item))
{
// This handles the trailing slash case
continue;
if (!exactPath.EndsWith(StringLiterals.DefaultPathSeparator))
{
exactPath += StringLiterals.DefaultPathSeparator;
}

break;
}
else if (item.Contains('~'))
{
Expand All @@ -159,11 +164,6 @@ private static string GetCorrectCasedPath(string path)
}
}

if (path.EndsWith(StringLiterals.DefaultPathSeparator))
{
return exactPath + StringLiterals.DefaultPathSeparator;
}

return exactPath;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ Describe "Get-Item" -Tags "CI" {
$result.Exists | Should -BeTrue
}

It "Should return correct result for ToString() on root of drive" {
$root = $IsWindows ? "${env:SystemDrive}\" : "/"
(Get-Item -Path $root).ToString() | Should -BeExactly $root
}

Context "Test for Include, Exclude, and Filter" {
BeforeAll {
${testBaseDir} = "${TESTDRIVE}/IncludeExclude"
Expand Down