public/Get-SlackBuildHelperConfig.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Function Get-SlackBuildHelperConfig {
    [cmdletbinding(DefaultParameterSetName = 'source')]
    param(
        [parameter(ParameterSetName='source')]
        [ValidateSet("SlackBuildHelper","SlackBuildHelper.xml")]
        $Source = "SlackBuildHelper",

        [parameter(ParameterSetName='path')]
        [parameter(ParameterSetName='source')]
        $Path = "$ModuleRoot\SlackBuildHelper.xml"
    )
    
    if($PSCmdlet.ParameterSetName -eq 'source' -and $Source -eq "SlackBuildHelper" -and -not $PSBoundParameters.ContainsKey('Path'))
    {
        $Script:SlackBuildHelper
    }
    else
    {

        Import-Clixml -Path $Path
    }
}