-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResourceLocker.psm1
More file actions
23 lines (19 loc) · 900 Bytes
/
ResourceLocker.psm1
File metadata and controls
23 lines (19 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Requires -Version 3.0
$ModulePath = $PSScriptRoot
$ModuleName = ($MyInvocation.MyCommand.Name).Substring(0, ($MyInvocation.MyCommand.Name).Length - 5)
[string]$ModuleWideResourceDependenciesFilePath = Join-Path -Path $ModulePath -Childpath ('{0}-Dependencies.json' -f $ModuleName)
[int]$ModuleWideLockTimeout = 10
[int]$ModuleWideLockRetries = 3
[string]$ModuleWideLockHistoryFolderName = 'History'
[string]$ModuleWideLockFileNameTemplate = '{0}.lock'
[string]$ModuleWideLockFolderPathTemplate = '\\{0}\ResourceLocks'
foreach ($FunctionType in @('Private', 'Public')) {
$Path = Join-Path -Path $ModulePath -ChildPath ('{0}\*.ps1' -f $FunctionType)
if (Test-Path -Path $Path) {
Get-ChildItem -Path $Path -Recurse | ForEach-Object -Process {. $_.FullName}
}
}
$Path = Join-Path -Path $ModulePath -ChildPath 'Config.ps1'
if (Test-Path -Path $Path -PathType Leaf) {
. $Path
}