icinga-powershell-framework/lib/core/dev/Get-IcingaForWindowsComponentPublicFunctions.psm1
2022-04-27 11:20:35 +02:00

31 lines
981 B
PowerShell

function Get-IcingaForWindowsComponentPublicFunctions()
{
param (
$FileObject = $null,
[string]$ModuleName = ''
);
[array]$ExportFunctions = @();
# First first if we are inside a public space
if ((Test-IcingaForWindowsComponentPublicFunctions -FileObject $FileObject -ModuleName $ModuleName) -eq $FALSE) {
$FileData = (Read-IcingaPowerShellModuleFile -File $FileObject.FullName);
foreach ($entry in $FileData.FunctionList) {
if ($entry.Contains('Global:')) {
$ExportFunctions += $entry.Replace('Global:', '');
}
}
$ExportFunctions += $FileData.ExportFunction;
return $ExportFunctions;
}
$FileData = (Read-IcingaPowerShellModuleFile -File $FileObject.FullName);
$ExportFunctions += $FileData.FunctionList;
$ExportFunctions += $FileData.ExportFunction;
# If we are, add all functions we found
return $ExportFunctions;
}