diff --git a/preferences/powershell-wpf.md b/preferences/powershell-wpf.md index 30c7380..72fafc8 100644 --- a/preferences/powershell-wpf.md +++ b/preferences/powershell-wpf.md @@ -3,6 +3,13 @@ ## General Rules - Always include `#Requires -Version 5.1` at the top of every `.ps1` file +- Declare `$Version` immediately after `#Requires`, using semantic versioning (`"MAJOR.MINOR.PATCH"`): + +```powershell +#Requires -Version 5.1 +$Version = "1.0.0" +``` + - Use `$script:` scope for module-level variables — never `$Global:` unless absolutely necessary - Keep credential and sensitive values out of code — load from config files or environment variables only - Use `.psd1` files for all external configuration (not JSON, not XML, not hardcoded) @@ -65,6 +72,11 @@ Add-Type -AssemblyName System.Windows.Forms - Define XAML as a here-string and load it via `[System.Windows.Markup.XamlReader]::Parse()` - Use `$script:` variables to hold window/control references so they're accessible across functions +- Set the window title to include `$Version` after the app name: + +```powershell +$Window.Title = "App Name v$Version" +``` ## Modules