A step-by-step process performs a task through an ordered sequence of increasingly focused stages. Start broadly, narrow the request, verify each result, and revise before continuing. section 6.1.2
Use the process to keep complex AI-assisted work manageable:
- Begin with the broad task, then ask focused follow-up questions. section 6.1.2
- Work on one file or one requirement at a time when combined instructions cause errors. section 12.2.2
- Break large conversions into focused passes, then perform a final cleanup and formatting pass. section 12.2.5
- Verify every result and correct mistakes with follow-up prompts. section 6.1.2
Describe "Get-DbaDatabase" -Tag "UnitTests" {
BeforeAll {
$command = Get-Command Get-DbaDatabase
$expected = $TestConfig.CommonParameters
$expected += @(
"SqlInstance",
"SqlCredential",
"Database",
"Confirm",
"WhatIf"
)
}
Context "Parameter validation" {
It "Has parameter: <_>" -ForEach $expected {
$command | Should -HaveParameter $PSItem
}
It "Should have exactly the number of expected parameters" {
$hasparms = $command.Parameters.Values.Name
Compare-Object -ReferenceObject $expected `
-DifferenceObject $hasparms | Should -BeNullOrEmpty
}
}
}
A concrete converted test shows how focused requirements become organized setup, validation, and assertions. section 12.2.2
