Garbage-Collector.psm1
# +++++++++++++++++++++++++++++ # Get configuration File Try { $FunctionFile = Get-Content (Join-Path -Path $PSScriptRoot -ChildPath "Config.json") -ErrorAction Stop $Types = ($FunctionFile | ConvertFrom-Json ).Type } Catch { Throw [System.NotImplementedException]::New("Unable to get configuration : $_") } # +++++++++++++++++++++++++++++ # Get Function Try { foreach($Type in $Types) { foreach($Function in $Type.Function) { . (join-Path -Path $PSScriptRoot -ChildPath "Function\$($Type.name)\$Function.ps1") } } } Catch { Throw [System.NotImplementedException]::New("Unable to get function : $_") } |