This commit is contained in:
OCram85 2022-06-28 10:32:25 +02:00
parent ac0431ea17
commit 5b4d043c7d
3 changed files with 12 additions and 17 deletions

11
src/ModuleRoot.psm1 Normal file
View File

@ -0,0 +1,11 @@
#region module-definition
#endregion module-definition
Set-Variable -Name "CSVersion" -Value "2.0.0" -Option Constant -Scope 'Script' -ErrorAction Stop
# Get all child items in the Script path and exclude the Deploy script (if present.)
$Functions = Get-ChildItem -Path $PSScriptRoot\*.ps1 -Recurse | Where-Object { $_.BaseName -notmatch '.Tests' }
foreach ($Item in $Functions) {
. $Item.FullName
}

View File

@ -1,7 +1,7 @@
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PSCredentialStore.psm1'
RootModule = 'ModuleRoot.psm1'
# Version number of this module.
ModuleVersion = '0.0.9999'

View File

@ -1,16 +0,0 @@
#region module-definition
#endregion module-definition
Set-Variable -Name "CSVersion" -Value "2.0.0" -Option Constant -Scope 'Script' -ErrorAction Stop
#region dot-sourcing
# dot-sourcing all module functions. The export is handled via manifest file.
$Items = (Get-ChildItem -Path (Join-Path -Path $PSScriptRoot -ChildPath '*.ps1') -Recurse ).FullName | Where-Object {
$_ -notmatch "(Classes|Init)"
}
foreach ($Item in $Items) {
# Write-Verbose ("dot sourcing file {0}" -f $Item)
. $Item
}
#endregion dot-sourcing