.requirements/PSNeo4j/0.0.31/Public/Get-PSNeo4jConfiguration.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function Get-PSNeo4jConfiguration {
    <#
    .SYNOPSIS
       Get PSNeo4j configuration values

    .DESCRIPTION
       Get PSNeo4j configuration values

    .EXAMPLE
        Get-PSNeo4jConfiguration

    .PARAMETER Source
        Get PSNeo4j configuration from the module variable, or config file. Defaults to variable


    .FUNCTIONALITY
        Neo4j
    #>

    param(
        [validateset('Variable','Config')]
        [string]$Source = "Variable"
    )
    if($Source -eq 'Config' -and $SkipConfig) {
        Write-Warning "Configuration module not available. Switching to 'Variable' data"
        $Source = 'Variable'
    }
    if($Source -eq 'Config') {
        $Config = Import-Configuration -CompanyName 'NA' -Name 'NA'
        [pscustomobject]$Config | Select-Object $Script:ConfigSchema.PSObject.Properties.Name
    }
    if($Source -eq 'Variable') {
        $Script:PSNeo4jConfig
    }
}