Use these scripts to validate your environment and explore Azure region data. Run them from the repo root or from the PowerShell folder with PowerShell 7.2+.
- PowerShell 7.2 or later (
pwsh --version) - Modules:
Az.Accounts,Az.Resources(install withInstall-Module -Name Az -Scope CurrentUser) - For Excel export (
-ExportToExcelflags):ImportExcelmodule (install withInstall-Module -Name ImportExcel -Scope CurrentUser) - Azure sign-in required for region/provider scripts (
Connect-AzAccount) - Internet access for the Azure Retail Prices API (Compare-Pricing)
- From the repo root:
pwsh -ExecutionPolicy Bypass -File PowerShell/Validate-Setup.ps1
- The script checks:
- PowerShell version (needs 7.2+)
- Required Az modules
- Azure sign-in and active subscription
- Connectivity to the Retail Prices API (used by Compare-Pricing)
- Results are labeled PASS/WARN/FAIL. Resolve any FAIL items, then re-run until all required checks pass.
- Validate-Setup.ps1: Verifies prerequisites for all scripts.
- Get-TargetRegions.ps1: Compares registered resource providers in a source region against one or more target regions.
- Example:
pwsh -ExecutionPolicy Bypass -File PowerShell/Get-TargetRegions.ps1 -SourceRegion eastus -TargetRegions westus2,northeurope
- Add
-ExportToExcelto save summary/missing providers to Excel.
- Example:
- Get-ZoneMapping.ps1: Lists logical-to-physical availability zone mappings per region for the active subscription, with region metadata.
- Example:
pwsh -ExecutionPolicy Bypass -File PowerShell/Get-ZoneMapping.ps1
- Add
-ExportToExcelto save results (all/recommended/other) to Excel.
- Example:
- Compare-Pricing.ps1: Pulls VM pricing via the Azure Retail Prices API and builds a region-vs-VM-size comparison table (optionally exports to Excel).
- Example (specific sizes and regions):
pwsh -ExecutionPolicy Bypass -File PowerShell/Compare-Pricing.ps1 -VMSizes Standard_B1s,Standard_D2s_v3 -Regions eastus,westus2
- Add
-ExportToExcelto save results beside the script.
- Example (specific sizes and regions):
- Run
Connect-AzAccountfirst for region/provider scripts to avoid prompts. - Some scripts cache API results during the session or on disk to speed up reruns; you can opt out when prompted.
- If your organization restricts script execution, include
-ExecutionPolicy Bypassas shown in the examples.