functions/private/Set-ModuleVariable.ps1

1
2
3
4
5
6
7
8
9
10
Function Set-ModuleVariable {
    [cmdletbinding()]
    param()
    $Config = Get-Content "$Root\config.json" | Out-String | ConvertFrom-Json
    foreach($Property in ($Config.config|gm -MemberType NoteProperty).Name){
        $null = New-Variable -Scope Script -Name $Property -Value $($Config.config.$Property) -Force
        write-verbose "Creating property '$Property' with value '$($Config.config.$Property)'"
    }
   
}