mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Update to use windows-latest as the build agent image (#16831)
This commit is contained in:
+9
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user