Skip to content

Commit c80ec9a

Browse files
authored
Add a script to count generated cmdlets (#15987)
1 parent 677909f commit c80ec9a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tools/cmdletcount.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Usage
2+
# ./cmdletcount.ps1 -path ../src/
3+
4+
param([string]$path = './')
5+
6+
$moduleList = @('ADDomainServices', 'Aks/Aks.Autorest', 'AppConfiguration','Blockchain','BotService','ChangeAnalysis','CloudService','Communication','Confluent','ConnectedKubernetes','ConnectedMachine','ContainerInstance','CostManagement','CustomProviders', 'DataBox', 'Databricks','Datadog','DataProtection','DedicatedHsm','DesktopVirtualization','DigitalTwins','DiskPool','DnsResolver','Elastic','Functions','HanaOnAzure','HealthBot','ImageBuilder','ImportExport','KubernetesConfiguration','Kusto','Maps','MariaDb','Migrate','MonitoringSolutions','MySql','Portal','PostgreSql','ProviderHub','Purview','RedisEnterpriseCache','ResourceGraph/ResourceGraph.Autorest','ResourceMover','SpringCloud','StreamAnalytics','Synapse/Synapse.Autorest','TimeSeriesInsights','VMware','Websites/Websites.Autorest','WindowsIotServices')
7+
8+
$resultFile = './result.csv'
9+
10+
$result = @()
11+
12+
foreach ($module in $moduleList) {
13+
$modulePath = Join-Path (Join-Path $path $module) docs
14+
$customPath = Join-Path (Join-Path $path $module) custom
15+
$module = $module.Split('/')[0]
16+
$cmdlets = Get-ChildItem $modulePath -Exclude readme.md, "Az.$module.md", "$module.md" | foreach {$_.name.Split(".")[0]}
17+
foreach ($cmdlet in $cmdlets) {
18+
$isCustom = Get-ChildItem $customPath -Include "$cmdlet.ps1" -Recurse
19+
$genMode = "Autogen"
20+
if ($isCustom) {
21+
$genMode = "Custom"
22+
}
23+
$item = @{Module = "Az.$module"; Cmdlet = "$cmdlet"; GenMode = "$genMode"}
24+
$result += [pscustomobject]$item
25+
}
26+
}
27+
28+
$result | ConvertTo-Csv | Out-File -Path $resultFile

0 commit comments

Comments
 (0)