This example illustrates how to un-publish applications from a catalog in a customer’s account using PowerShell.

functionUnPublishCatalogApplications{param([Parameter(Mandatory=$true)][string]$customerId,[Parameter(Mandatory=$true)][string]$siteId,[Parameter(Mandatory=$true)][string]$bearerToken,[Parameter(Mandatory=$true)][string]$catalogId,[Parameter(Mandatory=$true)][string[]]$appIds)$query=[System.Web.HttpUtility]::ParseQueryString([String]::Empty)foreach($appIdin$appIds){$query.Add("appIds",$appId)}$requestUri=[string]::Format("https://catalogs.apps.cloud.com/{0}/{1}/catalogs/{2}/apps?{3}",$customerId,$siteId,$catalogId,$query.ToString())$headers=@{"Accept"="application/json";"Authorization"="CwsAuth bearer=$bearerToken"}$response=Invoke-RestMethod-Uri$requestUri-MethodDELETE-Headers$headersreturn$response}$customerId="customer1"#Replace with your customerId$siteId="61603f15-cdf9-4c7f-99ff-91636601a795"#Replace with your site ID$bearerToken="ey1.."#See Prerequisites for all API calls section for a sample of how to get your bearer token$catalogId="56f1cbf3-1cc6-40cd-9c82-c95633ba88bb"#Replace with your catalog ID$appIds=@("50af6370-fff1-4fc9-b082-a33761fd2f20","37ee73e3-8dc1-4f8d-8924-cef5724e3305","804af829-5701-48ef-b4e4-f91d2012f816")#Replace with your app ids$response=UnPublishCatalogApplications$customerId$siteId$bearerToken$catalogId$appIds