Public/Invoke-SfObjectGet.ps1

<#
    .SYNOPSIS
    Gets a Salesforce object

    .DESCRIPTION
    Gets a Salesforce object

    .INPUTS
    A Salesforce object Id

    .OUTPUTS
    A PSCustomObject that represent the Salesfsorce object

    .PARAMETER Type
    The type of object

    .PARAMETER Id
    The Salesforce object Id

    .EXAMPLE
    PS> Invoke-SfObjectGet -Type phecc__Device__c -Id "a0N3t000008XXe5EAG"

    .LINK
    Set-Config

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

function Invoke-SfObjectGet {

    [CmdletBinding()]
    [OutputType([PSCustomObject])]
    param(
        [Parameter(Mandatory = $true, Position = 0)]
        [ValidateNotNullOrEmpty()]
        [String]
        $Type,

        [Parameter(Mandatory = $true, Position = 1, ValueFromPipeline)]
        [ValidateNotNullOrEmpty()]
        [String]
        $Id
    )

    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-SfApi "/sobjects/$($Type)/$($Id)" -Method Get
    }
}