- Use `Describe`, `Context`, and `It` blocks to structure Pester tests; each `It` block asserts one behavior with a descriptive string.
- Use `Should -Be`, `Should -BeExactly`, `Should -Throw`, and `Should -Not -BeNullOrEmpty` assertion methods inside `It` blocks.
- Name test files with the `.Tests.ps1` suffix and place them alongside or in a `tests/` mirror of the source file they test.
- Use `BeforeAll` and `AfterAll` for expensive setup/teardown (module imports, connection setup) and `BeforeEach`/`AfterEach` for per-test state reset.
- Mock cmdlets and functions with `Mock Get-Content { return 'fake' }` to isolate units under test from filesystem, network, and registry dependencies.
- Use `Should -Invoke -CommandName Get-Item -Times 1 -Exactly` to assert that a mocked cmdlet was called the expected number of times.
- Run tests with `Invoke-Pester -Output Detailed` in CI and pass `-CI` to fail the pipeline on any test failure.