Files
PowerShell/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1
T

24 lines
829 B
PowerShell
Raw Normal View History

2016-07-25 14:01:41 -07:00
Describe "Import-Module" -Tags "CI" {
2016-04-08 15:13:01 -07:00
$moduleName = "Microsoft.PowerShell.Security"
BeforeEach {
Remove-Module -Name $moduleName -Force
2017-01-16 13:31:14 -08:00
(Get-Module -Name $moduleName).Name | Should BeNullOrEmpty
}
AfterEach {
Import-Module -Name $moduleName -Force
(Get-Module -Name $moduleName).Name | Should Be $moduleName
}
It "should be able to add a module with using Name switch" {
2017-01-16 13:31:14 -08:00
{ Import-Module -Name $moduleName } | Should Not Throw
(Get-Module -Name $moduleName).Name | Should Be $moduleName
}
It "should be able to add a module with using ModuleInfo switch" {
$a = Get-Module -ListAvailable $moduleName
{ Import-Module -ModuleInfo $a } | Should Not Throw
(Get-Module -Name $moduleName).Name | Should Be $moduleName
}
2016-04-08 15:13:01 -07:00
}