mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-18 10:08:00 -05:00
Fixes possible crash on assembly fetching for third party assemblies
This commit is contained in:
parent
507575c5a9
commit
91c91df9b7
1 changed files with 7 additions and 4 deletions
|
|
@ -31,12 +31,15 @@ function Test-IcingaAddTypeExist()
|
|||
}
|
||||
|
||||
foreach ($entry in [System.AppDomain]::CurrentDomain.GetAssemblies()) {
|
||||
if ($entry.GetTypes() -Match $Type) {
|
||||
$LoadedTypes.Add($Type, $TRUE);
|
||||
try {
|
||||
if ($entry.GetTypes() -Match $Type) {
|
||||
$LoadedTypes.Add($Type, $TRUE);
|
||||
|
||||
Set-IcingaPrivateEnvironmentVariable -Name 'AddTypeFunctions' -Value $LoadedTypes;
|
||||
Set-IcingaPrivateEnvironmentVariable -Name 'AddTypeFunctions' -Value $LoadedTypes;
|
||||
|
||||
return $TRUE;
|
||||
return $TRUE;
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue