2016-07-25 23:01:41 +02:00
|
|
|
|
Describe "Import-Module" -Tags "CI" {
|
2016-04-09 00:13:01 +02:00
|
|
|
|
$moduleName = "Microsoft.PowerShell.Security"
|
2016-03-18 10:30:26 +01:00
|
|
|
|
|
|
|
|
|
BeforeEach {
|
|
|
|
|
Remove-Module -Name $moduleName -Force
|
|
|
|
|
(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" {
|
|
|
|
|
{ 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-09 00:13:01 +02:00
|
|
|
|
}
|