added versioning for powershell apps

This commit is contained in:
2026-05-08 00:07:49 -07:00
parent be959c7ae9
commit 7f030396fb
+12
View File
@@ -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