Those scripts allow to perform an operation (a script block) to every item in Azure API Management. Supported scripts are:
foreach-api.ps1
foreach-api-operation.ps1
foreach-product.ps1
Those scripts call the following more general - albeit slightly more complex - script:
foreach-apim-object.ps1
Using any script block, you can perform any operation on, say, all apis or all products. For instance, to display all apis, type the following command:
PS> . ./foreach-api.ps1 { echo $_ }
Using the provided with-policy.ps1
sample file below, you can find all apis, or products that have a policy containing a given syntax, for instance.
PS> . ./foreach-product.ps1 (. ./with-policy.ps1)