-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhealOps.psm1
39 lines (32 loc) · 1.24 KB
/
healOps.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
28
29
30
31
32
33
34
35
36
37
38
39
<#
- Import classes
#>
. $PSScriptRoot/Private/MetricsSystem/MetricItem.Class.ps1
<#
- Determine system specific values
#>
# PowerShell below 5 is not module versioning compatible. Reflect this.
if($PSVersionTable.PSVersion.ToString() -gt 4) {
[Boolean]$global:psVersionAbove4 = $true
} else {
[Boolean]$global:psVersionAbove4 = $false
}
# RunMode global variable
[Boolean]$global:runMode = test-powershellRunMode -Interactive
# Define the foldernames
$functionFolders = @('Public', 'Private')
# Run over each folder and look for files to include/inject into the PSD1 manifest file
ForEach ($folder in $functionFolders) {
$folderPath = Join-Path -Path $PSScriptRoot -ChildPath $folder
If (Test-Path -Path $folderPath) {
Write-Verbose -Message "Importing from $folder"
$functions = Get-ChildItem -Path $folderPath -Filter '*.ps1' -Recurse;
ForEach ($function in $functions) {
Write-Verbose -Message " Importing $($function.BaseName)"
. $($function.FullName)
}
}
}
$publicFunctions = (Get-ChildItem -Path "$PSScriptRoot\Public" -Filter '*.ps1' -Recurse).BaseName
# Export the public functions
Export-ModuleMember -Function $publicFunctions