AppSource/Get-AppSourceProducts.ps1

<#
 .Synopsis
  Get all AppSource products belonging to the authenticated account
 .Description
  Returns an array of PSCustomObject with your AppSource products
 .Parameter authContext
  Authentication Context from New-BcAuthContext
 .Parameter silent
  Include this switch if you do not want the method to display URLs etc.
 .Example
  @(Get-AppSourceProducts -authContext $authcontext -silent)
 
  resourceType : AzureDynamics365BusinessCentral
  name : C5 2012 Data Migration
  externalIDs : {@{type=AzureOfferId; value=c5-2012-data-migration}}
  isModularPublishing : True
  id : bc09759f-4d41-4d56-a57a-2f7e4cfad4a2
   
  resourceType : AzureDynamics365BusinessCentral
  name : ELSTER VAT Localization for Germany
  externalIDs : {@{type=AzureOfferId; value=elster-vat-file-de}}
  isModularPublishing : True
  id : 29cb661d-ea77-4415-ac43-b0f7a90cd9b5
   
  resourceType : AzureDynamics365BusinessCentral
  name : PayPal Payments Standard
  externalIDs : {@{type=AzureOfferId; value=fb310c16-0b22-4569-a5f0-8f9a01571cee}}
  isModularPublishing : True
  id : 193aec22-a99f-4024-8aba-c01ec540c0b7
 
  ...
#>

function Get-AppSourceProducts {
    Param(
        [Parameter(Mandatory=$true)]
        [HashTable] $authContext,
        [switch] $silent
    )

$telemetryScope = InitTelemetryScope -name $MyInvocation.InvocationName -parameterValues $PSBoundParameters -includeParameters @()
try {
    @(Invoke-IngestionApiGetCollection -authContext $authContext -path '/products' -silent:($silent.IsPresent))
}
catch {
    TrackException -telemetryScope $telemetryScope -errorRecord $_
    throw
}
finally {
    TrackTrace -telemetryScope $telemetryScope
}
}
Export-ModuleMember -Function Get-AppSourceProducts