-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEulandaConnect.psm1
More file actions
57 lines (47 loc) · 1.74 KB
/
EulandaConnect.psm1
File metadata and controls
57 lines (47 loc) · 1.74 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<#
.SYNOPSIS
A debugging helper module for functions in the EulandaConnect module.
.DESCRIPTION
This module is intended to aid in debugging the ps1 files in both the
private and public folders of the EulandaConnect module.
It is recommended that a debug project be created in the root of
the project in order to load this module using the following command:
Import-Module "C:\Git\Powershell\EulandaConnect\EulandaConnect.psm1" -force
LEAVE THIS UNCHANGED, IT HAS TO WORK LIKE IT IS.
#>
Write-Verbose -Message ('Starting: {0}' -f $myInvocation.Mycommand)
Get-Module -Name "EulandaConnect" -All | ForEach-Object {
Remove-Module -ModuleInfo $_ -ErrorAction SilentlyContinue
}
$params = @{
Filter = '*.ps1'
Recurse = $true
ErrorAction = 'Stop'
}
try {
[string]$path = $PSScriptRoot
if (! $path) {
$path = 'C:\Git\Powershell\EulandaConnect'
}
# Set-StrictMode is set in variables.ps1
$variables = @(Get-ChildItem -Path "$path\source\others\Variables.ps1")
$initialize = @(Get-ChildItem -Path "$path\source\others\Initialize.ps1")
$public = @(Get-ChildItem -Path "$path\source\public" @params)
$private = @(Get-ChildItem -Path "$path\source\private" @params)
}
catch {
Write-Error $_
throw 'Debug-Helper EulandaConnect.psm1: Unable to read source files from public or private.'
}
# Import all files as dot-source
foreach ($file in @($variables + $initialize + $public + $private)) {
try {
Write-Verbose "$($file.FullName)"
. $file.FullName
}
catch {
throw "Debug-Helper EulandaConnect.psm1: Unable to import file [$($file.FullName)]. ERROR: $_"
}
}
Export-ModuleMember -Variable *
Export-ModuleMember -Function $public.Basename