make the cloud backup update script require powershell 4 and make that the repo default for new scripts

This commit is contained in:
2026-11-17 10:43:19 -05:00
parent 2bbb07c05e
commit 4e766357cc
5 changed files with 37 additions and 13 deletions
+12 -4
View File
@@ -2,6 +2,12 @@
## RMM script execution model
Target **Windows PowerShell 4.0** by default for new Windows RMM scripts. Put
`#Requires -Version 4.0` in both the RMM caller and its downloaded core. Use
4.0-compatible syntax, cmdlets and .NET APIs throughout their execution path,
including shared helpers. If a workload genuinely needs a newer version,
document the dependency alongside its version requirement.
This is the required convention for new RMM scripts. Read both
[`Install-MicrosoftOffice365.ps1`](Install-MicrosoftOffice365.ps1) and its
[`rmm/Install-MicrosoftOffice365.ps1`](rmm/Install-MicrosoftOffice365.ps1) caller
@@ -75,7 +81,7 @@ $QuickBooksGraceSeconds = '60'
- Download `Tools.ps1` live when needed. **Do not cache `Tools.ps1` or its helper
definitions**, or introduce an offline Tools fallback. This is an explicit
repository preference; the cloud-backup workflow requires network access.
- Set TLS 1.2 before the first HTTPS download on Windows PowerShell 5.
- Set TLS 1.2 before the first HTTPS download on Windows PowerShell 4.0 and 5.x.
- Normally dot-source live `Tools.ps1` as shown above, then call `Run-Script`.
The QuickBooks permanent backup shim has a documented specialized loader: it
downloads Tools live and dot-sources only its two conversion definitions to
@@ -85,6 +91,8 @@ $QuickBooksGraceSeconds = '60'
from `resources/quickbooks/QuickBooksBackup.ps1`. All code is fetched live;
only recovery state/logs persist. Start must not call a local Stop shim or use
a cached Stop script in a hidden restore mode.
- Use focused Windows PowerShell 5 tests to verify actual shim-to-core input
visibility, string-to-boolean/list conversion, and exit-code propagation when
changing these boundaries. Mock downloads and disruptive actions during tests.
- Test shim-to-core input visibility, string conversions, and exit-code
propagation when changing these boundaries. Mock downloads and disruptive
actions. For the 4.0 baseline, run on Windows PowerShell 4.0 when available.
Otherwise check compatibility against the Server 2012 R2 / PowerShell 4.0
profile and run the focused tests on Windows PowerShell 5.1.