-
Notifications
You must be signed in to change notification settings - Fork 3
/
PS-OpenAI.psm1
33 lines (27 loc) · 2.07 KB
/
PS-OpenAI.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
<#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module: PS-OpenAI
Function: Dot-Source the Public & Private .ps1 Function Files
Author: Martin Cooper (@mc1903)
Date: 21-01-2023
GitHub Repo: https://github.com/mc1903/PS-OpenAI
Version: 1.0.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#>
If ($MyInvocation.Line -Match "-Verbose") {
$VerbosePreference = "Continue"
}
$Public = @(Get-ChildItem -Path $PSScriptRoot\Src\Public\*.ps1 -ErrorAction SilentlyContinue)
$Private = @(Get-ChildItem -Path $PSScriptRoot\Src\Private\*.ps1 -ErrorAction SilentlyContinue)
ForEach ($Module in @($Public + $Private)) {
Write-Verbose -Message "Trying function $($Module.FullName): $_"
Try {
. $Module.FullName
}
Catch {
Write-Error -Message "Failed to import function $($Module.FullName)"
}
}
Export-ModuleMember -Function $Public.BaseName -Alias *
Export-ModuleMember -Function $Private.BaseName
$VerbosePreference = "SilentlyContinue"