Public/Get-SfSObjectDescribe.ps1
<# .SYNOPSIS Get a salesforce describe object .DESCRIPTION Get a salesforce metadata for a specified object name .INPUTS The object name to describe .OUTPUTS An PSCustomObject containing the object metadata. .EXAMPLE PS> $describe = Get-SfSObjectDescribe "phecc__Device__c" .LINK https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_describe.htm .NOTES Assumes config is initialized for org access. #> function Get-SfSObjectDescribe { [CmdletBinding()] [OutputType([PSCustomObject])] param( [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline)] [ValidateNotNullOrEmpty()] [String] $ObjectName ) 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/$($ObjectName)/describe" } } |