Snippets

powershell

Complete, checked snippets in this language.

powershell

Create a planning config template

A complete PowerShell script that writes a sanitized JSON planning config with placeholder scope, labels, and app split rules.

Parsed with PowerShell 7.6.2 and ran locally, producing JSON that ConvertFrom-Json could read

powershell

Retry a rate-limited planning operation

A complete PowerShell script that retries a synthetic operation when it returns retry-after guidance.

Parsed with PowerShell 7.6.2 and ran locally with retry-after 1 and 0, negative parameter rejection, MaxRetries 0 = one attempt, and MaxRetries 1 = one retry.

powershell

Roll a synthetic plan forward

A complete PowerShell script that merges prior finalized actuals, refreshed actuals, and forecast percentages by month key.

Parsed with PowerShell 7.6.2 and ran locally, preserving a synthetic analyst override while refreshing current actuals

powershell

Split synthetic subscription cost by resource group

A complete PowerShell script that matches synthetic resource-group cost rows to app slices and reconciles the remainder.

Parsed with PowerShell 7.6.2 and ran locally against synthetic cost rows, verifying overlapping slice rules do not double count and slice plus remainder totals reconcile