AutotaskOCH.psm1
<#
Denne filen er root-modulen til AutotaskOCH, og importerer script fra $PSScriptRoot\Public\ og $PSScriptRoot\Private\, som inneholder diverse funksjoner for arbeid med automatisering av systemene til Office Center H�nefoss. #> [CmdletBinding()] $PublicFunction = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue ) # Public functions can be called by user after module import $PrivateFunction = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue ) # Private functions can only be called internally in other functions in the module $Templates = @( Get-ChildItem -Path $PSScriptRoot\Templates\* -ErrorAction SilentlyContinue ) # Loading templates for $Templates $PublicFunction foreach ($Import in @($PublicFunction + $PrivateFunction)) { Write-Verbose "Importing $Import" try { . $Import.fullname } catch { throw "Could not import function $($Import.fullname): $_" } } Export-ModuleMember -Function $PublicFunction.Basename |