Public/Get-SfHsdpConfig.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
35
36
37
38
39
40
41
42
43
44
<#
    .SYNOPSIS
    Get the Salesforce org configured HSDP IAM configuration

    .DESCRIPTION
    Used to get access to the IAM endpoints accessing IAM configured for the salesforce org.

    .INPUTS
    None.

    .OUTPUTS
    A PSCustomObject with the properties:
        - phecc__Key__c
        - phecc__Secret__c
        - phecc__Access_Token_URL__c

    .EXAMPLE
    PS> Get-SfHsdpConfig

    .LINK
    Set-Config

    .NOTES
    Assumes config is initialized for org access.
#>

function Get-SfHsdpConfig {

    [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)"
        Invoke-SfQuery "SELECT phecc__Key__c,phecc__Secret__c,phecc__Access_Token_URL__c FROM phecc__HSDPAuthMetadata__mdt"
    }
}