-
Notifications
You must be signed in to change notification settings - Fork 0
/
AzureAPICrawler.psm1
27 lines (24 loc) · 1.12 KB
/
AzureAPICrawler.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[cmdletbinding()]
param()
# Load central config file; Config File can be referenced within module scope by $script:CONFIG
$moduleConfigPath = Join-Path $PSScriptRoot 'ModuleConfig.psd1'
$script:CONFIG = Import-PowerShellDataFile -Path (Resolve-Path ($moduleConfigPath))
$script:repoRoot = (Get-Item $PSScriptRoot).Parent.Parent.Parent
$script:moduleRoot = $PSScriptRoot
$script:src = Join-Path $PSScriptRoot 'src'
$script:temp = Join-Path $PSScriptRoot 'temp'
Write-Verbose 'Import everything in sub folders public & private'
$functionFolders = @('public', 'private')
foreach ($folder in $functionFolders) {
$folderPath = Join-Path -Path $PSScriptRoot -ChildPath $folder
If (Test-Path -Path $folderPath) {
Write-Verbose "Importing from $folder"
$functions = Get-ChildItem -Path $folderPath -Filter '*.ps1' -Recurse
foreach ($function in $functions) {
Write-Verbose (' Importing [{0}]' -f $function.BaseName)
. $function.FullName
}
}
}
$publicFunctions = (Get-ChildItem -Path "$PSScriptRoot\public" -Filter '*.ps1').BaseName
Export-ModuleMember -Function $publicFunctions