Replace DllImport with LibraryImport in SMA 2 (#18543)

This commit is contained in:
Ilya
2022-11-22 22:22:14 +05:00
committed by GitHub
parent 0d320ab89a
commit 8bc9fdb2a1
5 changed files with 144 additions and 91 deletions
@@ -659,7 +659,7 @@ Describe "FileSystem Provider Extended Tests for Get-ChildItem cmdlet" -Tags "CI
}
}
Describe "Validate Get-Item ResolvedTarget property" -Tag RequireAdminOnWindows {
Describe "Validate Get-Item ResolvedTarget property" -Tags "Feature","RequireAdminOnWindows" {
BeforeAll {
$rootDir = Join-Path "TestDrive:" "TestDir"
@@ -65,3 +65,17 @@ Describe "Temp: drive" -Tag Feature {
$res.Root | Should -BeExactly ([System.IO.Path]::GetTempPath())
}
}
Describe "Get-PSDrive for network path" -Tags "Feature","RequireAdminOnWindows" {
It 'Check P/Invoke GetDosDevice/QueryDosDevice' -Skip:(-not $IsWindows) {
$UsedDrives = Get-PSDrive | Select-Object -ExpandProperty Name
$PSDriveName = 'D'..'Z' | Where-Object -FilterScript {$_ -notin $UsedDrives} | Get-Random
subst "$($PSDriveName):" \\localhost\c$\Windows
$drive = Get-PSDrive $PSDriveName
$drive.DisplayRoot | Should -BeExactly '\\localhost\c$\Windows'
subst "$($PSDriveName):" /D
}
}