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"
|
2016-03-18 02:30:26 -07:00
|
|
|
|
|
|
|
|
BeforeEach {
|
|
|
|
|
Remove-Module -Name $moduleName -Force
|
2017-01-16 13:31:14 -08:00
|
|
|
(Get-Module -Name $moduleName).Name | Should BeNullOrEmpty
|
2016-03-18 02:30:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2016-03-18 02:30:26 -07:00
|
|
|
(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
|
|
|
}
|