Parameter & Variable Naming Rules
- Use direct parameters for 1-2 parameters
- Use
$splat<Purpose>
for 3+ parameters (never plain$splat
)
# Direct parameters $ag = Get-DbaLogin -SqlInstance $instance -Login $loginName # Splat with purpose suffix $splatPrimary = @{ Primary = $TestConfig.instance3 Name = $primaryAgName ClusterType = "None" FailoverMode = "Manual" Certificate = "dbatoolsci_AGCert" Confirm = $false } $primaryAg = New-DbaAvailabilityGroup @splatPrimary