Public/Get-SfSites.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
<#
    .SYNOPSIS
    Queries salesforce for site objects

    .DESCRIPTION
    Used to query for sites

    .INPUTS
    None. You cannot pipe objects to Get-SfSites.

    .OUTPUTS
    An array of PSCustomObject with the properties:
        Id

    .EXAMPLE
    PS> $sites = Get-SfSites

    .LINK
    Set-Config

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

function Get-SfSites {

    [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 Id,Name,phecc__City__c,phecc__Phone__c,phecc__State_Province__c,phecc__Street__c,phecc__Time_Zone__c,phecc__Zip_Postal_Code__c FROM phecc__Site__c"
    }
}