mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Improved Directory module loading
This commit is contained in:
parent
d164086280
commit
0028220e98
1 changed files with 5 additions and 4 deletions
|
|
@ -43,13 +43,14 @@ function Import-IcingaLib()
|
||||||
[string]$modulePath = $_.FullName;
|
[string]$modulePath = $_.FullName;
|
||||||
$moduleName = $_.Name.Replace('.psm1', '');
|
$moduleName = $_.Name.Replace('.psm1', '');
|
||||||
|
|
||||||
if ($ForceReload) {
|
if ($ListOfLoadedModules -like "*$moduleName*") {
|
||||||
if ($ListOfLoadedModules -like "*$moduleName*") {
|
if ($ForceReload) {
|
||||||
Remove-Module -Name $moduleName
|
Remove-Module -Name $moduleName
|
||||||
|
Import-Module ([string]::Format('{0}', $modulePath)) -Global;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Import-Module ([string]::Format('{0}', $modulePath)) -Global;
|
||||||
}
|
}
|
||||||
|
|
||||||
Import-Module ([string]::Format('{0}', $modulePath)) -Global;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$module = $module.Replace('.psm1', ''); # Cut possible .psm1 ending
|
$module = $module.Replace('.psm1', ''); # Cut possible .psm1 ending
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue