Add Get-ChildItem test (#10507)

This commit is contained in:
Ilya
2019-10-03 17:15:41 -07:00
committed by Aditya Patwardhan
parent 768e79a999
commit d7458c45b2
@@ -186,6 +186,27 @@ Describe "Get-ChildItem" -Tags "CI" {
$app.Target | Should -Not -Be $app.FullName
$app.LinkType | Should -BeExactly 'AppExeCLink'
}
It "Wildcard matching behavior is the same between -Path and -Include parameters when using escape characters" {
$oldLocation = Get-Location
try {
Set-Location $TestDrive
$expectedPath = 'a`[b]'
$escapedPath = 'a```[b`]'
New-Item -Type File $expectedPath -ErrorAction SilentlyContinue > $null
$WithInclude = Get-ChildItem * -Include $escapedPath
$WithPath = Get-ChildItem -Path $escapedPath
$WithInclude.Name | Should -BeExactly $expectedPath
$WithPath.Name | Should -BeExactly $expectedPath
} finally {
Set-Location $oldLocation
}
}
}
Context 'Env: Provider' {