Public/Get-Config.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
<#
    .SYNOPSIS
    Returns the current configuration for accessing the salesforce org and cdr/pds instance

    .INPUTS
    None. You cannot pipe objects to Convert-CsvToMessages.

    .OUTPUTS
    The current configured PSCustomObject
#>

function Get-Config {

    [CmdletBinding()]
    [OutputType([PSCustomObject])]
    param()

    begin {
        Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started"
    }

    end {
        Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete"
    }

    process {
        Write-Debug "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)"

        Get-Variable -Name __config -Scope Script -ValueOnly -ErrorAction SilentlyContinue
    }
}