Updated preference files

This commit is contained in:
2026-04-03 00:56:48 -07:00
parent 9bf97c2358
commit 79fd6fd6db
5 changed files with 86 additions and 25 deletions

View File

@@ -104,6 +104,12 @@ Import-Module "$script:AppRoot\Modules\ProjectName.psm1" -Force
- Do **not** create test files — I'll run the code directly to verify it works
- If asked to write tests, use **Pester** with `Invoke-Pester -Path .\Tests\ -Output Detailed`
## Common Gotchas
- **Variable followed by colon:** `"$var: text"` fails — PowerShell treats `: text` as part of the variable name. Use `"${var}: text"` instead.
- **Returning arrays from functions:** A single-item array gets unrolled on return. Use `return ,$array` (comma prefix) to force PowerShell to return the array as-is.
- **UTF-8 file writes:** Use `[System.IO.File]::WriteAllText($path, $content, [System.Text.Encoding]::UTF8)` instead of `Out-File` — avoids BOM and encoding issues with special characters.
## Comments
- Comment the **why**, not the **what** — code should be readable on its own