- Total Commands: 684
- Total Categories: 10
- File Location:
c:\github\web\static\commands.json
| Rank | Category | Count | % | Type |
|---|---|---|---|---|
| 1 | Utilities | 318 | 46.5% | Catch-all |
| 2 | Security | 71 | 10.4% | Keyword-driven |
| 3 | Migration | 61 | 8.9% | Verb-driven |
| 4 | Performance | 48 | 7.0% | Domain-driven |
| 5 | Advanced Features | 44 | 6.4% | Domain-driven |
| 6 | Agent & Jobs | 43 | 6.3% | Tag-driven |
| 7 | Server Management | 34 | 5.0% | Tag + Verb-driven |
| 8 | Backup & Restore | 29 | 4.2% | Verb + Tag-driven |
| 9 | Database Operations | 28 | 4.1% | Tag + Domain-driven |
| 10 | Data Operations | 8 | 1.2% | Domain-driven |
Copy-* -> MIGRATION (32 commands, 98% accuracy)
Export-* -> MIGRATION (20 commands, 98% accuracy)
Backup-* -> BACKUP & RESTORE (5 commands)
Restore-* -> BACKUP & RESTORE (3 commands)
'agent' tag -> AGENT & JOBS (97% of category)
'certificate', 'encryption', 'login', 'permission' -> SECURITY
'instance' tag -> SERVER MANAGEMENT (47% of category)
'database' tag -> DATABASE OPERATIONS (39% of category)
'backup' tag -> BACKUP & RESTORE (72% of category)
'table' tag -> DATA OPERATIONS
Agent* nouns (AgentJob, AgentAlert) -> AGENT & JOBS
Database nouns (Database, DbFile, DbFileGroup) -> DATABASE OPERATIONS
Replication nouns (Endpoint, Replica, Repl*) -> ADVANCED FEATURES
Performance nouns (CPU, Memory, Wait, Latch, Plan, Trace, Queue) -> PERFORMANCE
DataOp nouns (DataGenerator, DataMasking, TableData) -> DATA OPERATIONS
Anything else -> UTILITIES (catch-all)
Rule: Catch-all for miscellaneous commands
- Dominant Verbs: Get (132), Remove (29), New (26), Invoke (25), Set (23), Test (18)
- No Tag Pattern: Mixed tags with no clear dominant pattern
- Characteristics:
- Largest category by far
- Get-* verbs that don't target specific domains
- Mixed operations (Add, Disable, Install, etc.)
- Default category when nothing matches
- Examples:
- Add-DbaAgListener
- Add-DbaExtendedProperty
- Clear-DbaConnectionPool
Rule: Keyword-based categorization
- Primary Tags: certificate (12), encryption (11), login (13), permission (5)
- Verbs: Get (22), Remove (14), New (10), Test (5), Add (3)
- Characteristics:
- Keywords in descriptions: Certificate, Encryption, Login, Permission, Credential
- Authentication, authorization, cryptography operations
- Mix of operations on different object types
- Examples:
- Add-DbaComputerCertificate
- Enable-DbaDbEncryption
- New-DbaLogin
- Add-DbaDbRoleMember
Rule: VERB-DRIVEN (98% accuracy)
- Primary Verbs: Copy (32), Export (20), Import (7)
- Characteristics:
- Moves server-level objects between instances
- Copy-* and Export-* patterns are almost always MIGRATION
- Exception: Copy-DbaBackupDevice goes to BACKUP & RESTORE
- Object types: Agent jobs, credentials, logins, server config, custom errors
- Examples:
- Copy-DbaAgentJob
- Export-DbaUser
- Copy-DbaDatabase
- Copy-DbaCredential
Rule: Domain/keyword-based categorization
- Keywords in Names: CPU, Memory, Wait, Latch, Plan, Trace, Queue, PowerPlan
- Verbs: Get (24), Clear (3), Invoke (2), Start/Stop (2 each)
- Characteristics:
- Performance monitoring and tuning
- Statistics clearing operations
- Extended Events and Trace operations
- SQL Server performance analysis
- Examples:
- Get-DbaCpuUsage
- Clear-DbaPlanCache
- Clear-DbaWaitStatistics
- Disable-DbaTraceFlag
Rule: Domain-based categorization
- Primary Nouns: Endpoint (7), Replica (4), Replication (3+), Partition
- Characteristics:
- Specialized SQL Server features
- Always On Availability Groups (replica operations)
- Replication (distributor, publisher, articles)
- Partitioning and endpoints
- More complex than UTILITIES
- Examples:
- Add-DbaAgReplica
- Get-DbaDbPartitionFunction
- Enable-DbaReplPublishing
Rule: TAG-DRIVEN (97% accuracy)
- Primary Tag: 'agent' present in 42/43 commands
- Secondary Tag: 'job' present in 21/43
- Verbs: Get (13), Set (9), New (8), Remove (8)
- Characteristics:
- Almost all commands have 'agent' tag
- SQL Server Agent operations
- Job steps, schedules, operators, alerts, categories
- Examples:
- Get-DbaAgentJob
- Set-DbaAgentSchedule
- New-DbaAgentProxy
Rule: TAG-DRIVEN + VERB-BASED
- Primary Tag: 'instance' present in 16/34 commands
- Verbs: Connect, Disconnect, Test, Update, Get (11)
- Characteristics:
- Instance-level connections and configurations
- Build info, patches, service configuration
- Hide instance settings
- Examples:
- Connect-DbaInstance
- Find-DbaInstance
- Get-DbaBuild
Rule: VERB-DRIVEN + TAG-DRIVEN
- Primary Verbs: Backup (5), Restore (3)
- Primary Tag: 'backup' present in 21/29 commands (72%)
- Characteristics:
- Full, differential, log backups
- Database, certificate, and key backups
- Backup device management
- Format and restore operations
- Examples:
- Backup-DbaDatabase
- Restore-DbaDatabase
- Find-DbaBackup
- Get-DbaBackupDevice
Rule: TAG-DRIVEN + DOMAIN-BASED
- Primary Tag: 'database' present in 11/28 commands
- Primary Nouns: Database (7), DbFile, DbFileGroup
- Verbs: Get (9), Set (5), Remove (4)
- Characteristics:
- Direct database object operations
- Mount, Dismount, Move, Rename operations
- Database files, filegroups, compatibility
- Note: NOT data inside databases (that's DATA OPERATIONS)
- Examples:
- Add-DbaAgDatabase
- Get-DbaDatabase
- Dismount-DbaDatabase
- Get-DbaDbFile
Rule: Domain-based categorization
- Primary Nouns: DbDataGenerator, DbDataMasking, TableData
- Characteristics:
- Specialized data operations
- Data generation and masking
- Table data manipulation
- Very small, distinct category
- Examples:
- Invoke-DbaDbDataMasking
- New-DbaDbDataGeneratorConfig
- Write-DbaDbTableData
- Copy/Export → MIGRATION (98% accuracy)
- Backup/Restore → BACKUP & RESTORE
- When verb indicates primary function, it's usually accurate
- 'agent' tag → AGENT & JOBS (97% of category)
- 'backup' tag → BACKUP & RESTORE (72% of category)
- 'instance' tag → SERVER MANAGEMENT (47% of category)
- Tags directly reflect command purpose
- Look for: certificate, encryption, login, permission in tags/description
- Not primarily verb-driven
- Mix of operations (Get, Remove, New, Set, Enable, Disable)
- Commands that don't fit anywhere else
- Dominated by Get-* operations (132/318)
- No consistent pattern
- Advanced Features, Performance, Data Operations require SQL Server knowledge
- Not easy to determine from tags alone
- Requires understanding what command does
- Copy verb → MIGRATION
- Export verb → MIGRATION
- Backup verb → BACKUP & RESTORE
- Restore verb → BACKUP & RESTORE
- 'agent' tag → AGENT & JOBS
- 'certificate' OR 'encryption' OR 'login' OR 'permission' tag → SECURITY
- 'backup' tag → BACKUP & RESTORE
- 'instance' tag → SERVER MANAGEMENT
- 'database' tag → DATABASE OPERATIONS
- 'table' tag → DATA OPERATIONS
- Domain keywords (CPU, Memory, Wait, Latch, Plan, Trace, Queue, PowerPlan, Endpoint, Replica, Replication, Partition) → PERFORMANCE or ADVANCED FEATURES
- Default → UTILITIES
- Extract verb from command name (Add, Get, Copy, Remove, etc.)
- Check against rules 1-4
- If no match, extract tags
- Check against rules 5-10
- If no match, analyze command description for domain keywords
- Check against rule 11
- If still no match, use UTILITIES (rule 12)
| Tag | Category | Frequency | Notes |
|---|---|---|---|
| agent | AGENT & JOBS | 97% of category | Highly reliable |
| backup | BACKUP & RESTORE | 72% of category | Primary indicator |
| certificate | SECURITY | Common | Security keyword |
| encryption | SECURITY | Common | Security keyword |
| login | SECURITY | Common | Security keyword |
| permission | SECURITY | Common | Security keyword |
| instance | SERVER MANAGEMENT | 47% of category | Common indicator |
| database | DATABASE OPERATIONS | 39% of category | Primary indicator |
| table | DATA OPERATIONS | Common | Data manipulation |
| copy | MIGRATION | ~52% of commands | Verb-based |
| export | MIGRATION | ~33% of commands | Verb-based |
- Verb: Copy → Rule 1 matches
- Decision: MIGRATION
- Verb: Get → No rule match
- Tags: get, database → Rule 9 matches (database tag)
- Decision: DATABASE OPERATIONS
- Verb: Get → No rule match
- Tags: get, agent, job → Rule 5 matches (agent tag, 97% reliable)
- Decision: AGENT & JOBS
- Verb: Add → No rule match
- Tags: add, certificate → Rule 6 matches (certificate tag)
- Decision: SECURITY
- Verb: Enable → No rule match
- Tags: enable, availability-groups → No rules match
- Description: "Enables trace flags" → Domain keyword: trace (rule 11)
- Decision: PERFORMANCE
- Verb: Get → No rule match
- Tags: get → No rules match
- Description: "Retrieves database file information" → Domain: database object (DbFile)
- Decision: DATABASE OPERATIONS
- Verb: Invoke → No rule match
- Tags: invoke → No rules match
- Description: "Masks sensitive data in databases" → Domain: data masking
- Decision: DATA OPERATIONS
| Verb | Utilities | Migration | Security | Performance | Advanced | Agent | Server Mgmt | Backup | Db Ops | Data Ops | Total |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Get | 132 | 0 | 22 | 24 | 19 | 13 | 11 | 7 | 9 | 0 | 237 |
| Copy | 0 | 32 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 33 |
| Export | 0 | 20 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 |
| Remove | 29 | 0 | 14 | 2 | 7 | 8 | 0 | 3 | 4 | 1 | 68 |
| New | 26 | 0 | 10 | 2 | 5 | 8 | 2 | 0 | 2 | 1 | 56 |
| Invoke | 25 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 0 | 2 | 30 |
| Set | 23 | 0 | 3 | 2 | 3 | 9 | 3 | 0 | 5 | 0 | 48 |
| Test | 18 | 1 | 5 | 2 | 2 | 1 | 4 | 3 | 2 | 2 | 40 |
| Backup | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 5 |
| Restore | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 3 |
| Other | 65 | 8 | 17 | 14 | 8 | 4 | 14 | 6 | 6 | 2 | 144 |
The categorization of dbatools commands follows a hierarchical decision tree:
- Verbs are the strongest indicator (Copy → MIGRATION, Backup → BACKUP & RESTORE)
- Tags are the second strongest indicator ('agent' → AGENT & JOBS, 'backup' → BACKUP & RESTORE)
- Domain/Noun analysis is necessary for remaining commands (requires SQL Server knowledge)
- UTILITIES is the catch-all for everything else
To replicate this categorization for new commands:
- Always check verb first
- Then check tags against the mapping table
- For remaining commands, analyze the command's domain and noun
- Default to UTILITIES if still uncertain
The most reliable categories (easiest to determine) are:
- Migration (98% accuracy with Copy/Export verbs)
- Agent & Jobs (97% accuracy with 'agent' tag)
- Backup & Restore (verb + tag combined)
The most ambiguous category is Utilities, which contains anything that doesn't fit other categories.