-
Notifications
You must be signed in to change notification settings - Fork 9
/
OSDUpdate.psm1
35 lines (32 loc) · 1.41 KB
/
OSDUpdate.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
<# if (!$(Get-Module -ListAvailable OSDSUS)) {
try {
Install-Module OSDSUS -ErrorAction Stop
}
catch {
Write-Error $_
Write-Error "Problem installing Module A dependency Module OSDSUS! Module A will NOT be loaded. Halting!"
$global:FunctionResult = "1"
return
}
}
try {
Import-Module OSDSUS -ErrorAction Stop
}
catch {
Write-Error $_
Write-Error "Problem importing Module A dependency Module OSDSUS! Module A will NOT be loaded. Halting!"
$global:FunctionResult = "1"
return
} #>
#===================================================================================================
# Import Functions
# https://github.com/RamblingCookieMonster/PSStackExchange/blob/master/PSStackExchange/PSStackExchange.psm1
#===================================================================================================
$OSDPublicFunctions = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$OSDPrivateFunctions = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
foreach ($Import in @($OSDPublicFunctions + $OSDPrivateFunctions)) {
Try {. $Import.FullName}
Catch {Write-Error -Message "Failed to import function $($Import.FullName): $_"}
}
Export-ModuleMember -Function $OSDPublicFunctions.BaseName
#===================================================================================================