-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPSOD.psm1
37 lines (31 loc) · 1.55 KB
/
PSOD.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
################################################################################
# Author : Antony Onipko
# Copyright : (c) 2016 Antony Onipko. All rights reserved.
################################################################################
# This work is licensed under the
# Creative Commons Attribution-ShareAlike 4.0 International License.
# To view a copy of this license, visit
# https://creativecommons.org/licenses/by-sa/4.0/
################################################################################
$configFile = (Join-Path -Path $psScriptRoot -ChildPath 'PSOD.config.json')
$PSOD = ConvertFrom-Json (Get-Content $configFile -Raw)
# if no ApplicationId in the settings file, check onedrive.opt file.
if (!$PSOD.auth.applicationId) {
$appIdFile = (Join-Path -Path $psScriptRoot -ChildPath 'onedrive.opt')
if (Test-Path $appIdFile) {
$PSOD.auth.applicationId = Get-Content $appIdFile -Raw
}
}
Add-Member -InputObject $PSOD `
-NotePropertyName token `
-NotePropertyValue (New-Object PsObject)
Export-ModuleMember -Variable PSOD
################################################################################
. (Join-Path -Path $psScriptRoot -ChildPath 'PSOD.helpers.ps1')
################################################################################
Get-ChildItem -Path $psScriptRoot `
| ? { $_ -match '^Func_.+$' } `
| % {
. (Join-Path -Path $psScriptRoot -ChildPath $_)
}
################################################################################