Update to use windows-latest as the build agent image (#16831)

This commit is contained in:
Dongbo Wang
2022-02-07 17:34:52 -08:00
committed by GitHub
parent a5d41c2287
commit 30eac0a11e
9 changed files with 34 additions and 16 deletions
@@ -600,9 +600,14 @@ Describe "Additional tests for Import-Module with WinCompat" -Tag "Feature" {
It "NoClobber WinCompat import works for an engine module through -UseWindowsPowerShell parameter" {
# pre-test cleanup
Get-Module -Name Microsoft.PowerShell.Management | Remove-Module
Import-Module -Name Microsoft.PowerShell.Management # import the one that comes with PSCore
Import-Module Microsoft.PowerShell.Management -UseWindowsPowerShell
$modules = Get-Module -Name Microsoft.PowerShell.Management
$modules.Count | Should -Be 2
$proxyModule = $modules | Where-Object {$_.ModuleType -eq 'Script'}
$coreModule = $modules | Where-Object {$_.ModuleType -eq 'Manifest'}
@@ -703,6 +708,10 @@ Remove-Module $desktopModuleToUse
Restore-ModulePath
}
BeforeEach {
Get-PSSession -Name WinPSCompatSession -ErrorAction SilentlyContinue | Remove-PSSession
}
AfterEach {
Get-Module $allModules | Remove-Module -Force
}