Tools/Estimate-PowerAppsLicenses.ps1

# Estimate-PowerAppsLicenses.ps1
# Simple estimator to compare Power Apps Per-User vs Per-App plan costs.

param(
    [int]$TotalUsers = 100,
    [int]$PremiumUsers = 10,
    [int]$PremiumAppsCount = 3,
    [int]$AvgUsersPerPremiumApp = 20,
    [decimal]$PricePerUserMonthly = 20.00,
    [decimal]$PricePerAppMonthly = 5.00,
    [switch]$ShowAnnual
)

<#
Notes:
- Defaults for prices are examples. Always confirm current prices on Microsoft Learn or the commercial marketplace.
- Per-app pricing in practice can include entitlements (e.g., a per-app license may cover up to N apps) — adjust math via $PricePerAppMonthly and app counts.
#>


Write-Host "Estimating Power Apps licensing (basic comparison)"
Write-Host "Total users: $TotalUsers; Premium users: $PremiumUsers; Premium apps: $PremiumAppsCount; Avg users/app: $AvgUsersPerPremiumApp"
Write-Host "Using PricePerUserMonthly=`$${PricePerUserMonthly}` and PricePerAppMonthly=`$${PricePerAppMonthly}`"
 
# Per-user model: license each premium user
$monthlyPerUser = $PremiumUsers * $PricePerUserMonthly
 
# Per-app model: license by app usage (per-user-per-app)
# Estimate total per-app licenses required = PremiumAppsCount * AvgUsersPerPremiumApp
$monthlyPerApp = $PremiumAppsCount * $AvgUsersPerPremiumApp * $PricePerAppMonthly
 
if ($ShowAnnual) {
    $annualPerUser = [math]::Round($monthlyPerUser * 12,2)
    $annualPerApp = [math]::Round($monthlyPerApp * 12,2)
    Write-Host "
Monthly cost - Per-user: `$${([math]::Round($monthlyPerUser,2))}   Per-app: `$${([math]::Round($monthlyPerApp,2))}" Write-Host "Annual cost  - Per-user: `$${$annualPerUser}   Per-app: `$${$annualPerApp}" } else { Write-Host "Monthly cost - Per-user: `$${([math]::Round($monthlyPerUser,2))}   Per-app: `$${([math]::Round($monthlyPerApp,2))}" } if ($monthlyPerUser -lt $monthlyPerApp) { Write-Host "Recommendation: Per-User plan is cheaper based on inputs." -ForegroundColor Green } elseif ($monthlyPerApp -lt $monthlyPerUser) { Write-Host "Recommendation: Per-App plan is cheaper based on inputs." -ForegroundColor Green } else { Write-Host "Recommendation: Costs are equal with the current inputs." -ForegroundColor Yellow } Write-Host "Notes:" Write-Host "- This estimator is a simple model. Consider maker usage, Dataverse capacity, flows, portals and storage add-ons when finalizing quotes." Write-Host "- Verify current SKU semantics and prices on Microsoft Learn: https://learn.microsoft.com/power-platform/admin/pricing-billing-skus" Write-Host "Example runs:" Write-Host "  .\Estimate-PowerAppsLicenses.ps1 -TotalUsers 500 -PremiumUsers 50 -PremiumAppsCount 5 -AvgUsersPerPremiumApp 40 -PricePerUserMonthly 20 -PricePerAppMonthly 5"