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 @@ -161,14 +161,22 @@ private static string GetCorrectCasedPath(string path)
else
{
// Use GetFileSystemEntries to get the correct casing of this element
var entries = Directory.GetFileSystemEntries(exactPath, item);
if (entries.Length > 0)
try
{
exactPath = entries.First();
var entries = Directory.GetFileSystemEntries(exactPath, item);
if (entries.Length > 0)
{
exactPath = entries.First();
}
else
{
// If previous call didn't return anything, something failed so we just return the path we were given
return path;
}
}
else
catch
{
// If previous call didn't return anything, something failed so we just return the path we were given
// If we can't enumerate, we stop and just return the original path
return path;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,23 @@ Describe "Basic FileSystem Provider Tests" -Tags "CI" {
}
}

Context "Appx path" {
BeforeAll {
$skipTest = $true
if ($IsWindows -and (Get-Command -Name Get-AppxPackage) -and (Get-AppxPackage Microsoft.WindowsCalculator)) {
$skipTest = $false
}
}

It "Can get an appx package item" -Skip:$skipTest {
$pkgDir = (Get-AppxPackage)[0].InstallLocation

Get-Item $pkgDir\Calculator.exe -ErrorAction Stop | Should -BeOfType [System.IO.FileInfo]
Get-Item -Path $pkgDir -ErrorAction Stop | Should -BeOfType [System.IO.DirectoryInfo]
Get-ChildItem -Path $pkgDir -ErrorAction Stop | Should -Not -BeNullOrEmpty
}
}

Context "Validate basic host navigation functionality" {
BeforeAll {
#build semi-complex directory structure to test navigation within
Expand Down