Skip to content

Commit ecc2d03

Browse files
committed
v1.21.3 — Agent installer failsafe retry and diagnostics
If company defaults weren't loaded during startup, agent installer now automatically retries loading them before showing the error. Diagnostic output (ModuleRoot, CompanyDefaults, ToolName, BaseURL) shown if still misconfigured to aid troubleshooting.
1 parent 889248d commit ecc2d03

6 files changed

Lines changed: 41 additions & 4 deletions

File tree

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v1.21.3
4+
5+
- **Bug Fix:** Agent installer failsafe — if company defaults weren't loaded during startup, automatically retry loading when agent installer is accessed. Shows diagnostic info if still misconfigured.
6+
- 64 modules, 2291 tests
7+
38
## v1.21.2
49

510
- **Bug Fix:** Company defaults loading — first-run wizard no longer saves built-in defaults that overwrite company values on reload; company defaults files (*.defaults.json) are now properly detected and prompted even when defaults.json already exists (56-OperationsMenu).

Header.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
7h3 4b1d3r
3131
3232
.VERSION
33-
1.21.2
33+
1.21.3
3434
3535
.LAST UPDATED
3636
03/09/2026

Modules/00-Initialization.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ if (-not $script:ModuleRoot) { $script:ModuleRoot = $PSScriptRoot }
134134
if (-not $script:ModuleRoot -and $script:ScriptPath) {
135135
$script:ModuleRoot = [System.IO.Path]::GetDirectoryName($script:ScriptPath)
136136
}
137-
$script:ScriptVersion = "1.21.2"
137+
$script:ScriptVersion = "1.21.3"
138138
$script:ScriptStartTime = Get-Date
139139

140140
# OS version detection (for feature compatibility)

Modules/57-AgentInstaller.ps1

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,32 @@ function Install-Agent {
577577

578578
# --- Section: Pre-check - Feature Configuration ---
579579
if (-not (Test-AgentInstallerConfigured)) {
580+
# Safety net: if company defaults exist but weren't loaded, retry now
581+
if (-not $script:CompanyDefaultsPath) {
582+
$retryFiles = @(Get-CompanyDefaultsFiles)
583+
if ($retryFiles.Count -gt 0) {
584+
# Company defaults file exists but wasn't loaded — force reload
585+
if ($retryFiles.Count -eq 1) {
586+
$script:CompanyDefaultsName = $retryFiles[0].Name
587+
$script:CompanyDefaultsPath = $retryFiles[0].Path
588+
} else {
589+
$picked = Show-CompanyDefaultsPicker
590+
if ($null -ne $picked -and $picked -ne "__skip__") {
591+
$script:CompanyDefaultsName = $picked.Name
592+
$script:CompanyDefaultsPath = $picked.Path
593+
}
594+
}
595+
if ($script:CompanyDefaultsPath) {
596+
Import-Defaults
597+
if (Test-AgentInstallerConfigured) {
598+
# Retry succeeded — continue to agent installer
599+
Install-Agent @PSBoundParameters
600+
return
601+
}
602+
}
603+
}
604+
}
605+
580606
Clear-Host
581607
Write-OutputColor "" -color "Info"
582608
Write-OutputColor " ╔════════════════════════════════════════════════════════════════════════╗" -color "Info"
@@ -592,6 +618,12 @@ function Install-Agent {
592618
Write-OutputColor " in defaults.json or company defaults to enable this feature." -color "Warning"
593619
}
594620
Write-OutputColor "" -color "Info"
621+
# Diagnostic info to help troubleshoot
622+
Write-OutputColor " Debug: ModuleRoot = $script:ModuleRoot" -color "Debug"
623+
Write-OutputColor " Debug: CompanyDefaults = $script:CompanyDefaultsPath" -color "Debug"
624+
Write-OutputColor " Debug: ToolName = $script:AgentInstaller.ToolName" -color "Debug"
625+
Write-OutputColor " Debug: BaseURL = $script:FileServer.BaseURL" -color "Debug"
626+
Write-OutputColor "" -color "Info"
595627
Write-PressEnter
596628
return
597629
}

RackStack.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Environment-specific settings are configured via defaults.json.
1414
1515
.VERSION
16-
1.21.2
16+
1.21.3
1717
1818
.NOTES
1919
- Requires Windows Server 2012 R2 or later (or Windows 10/11 for testing)

Tests/Run-Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<#
22
.SYNOPSIS
3-
Automated Test Runner for RackStack v1.21.2
3+
Automated Test Runner for RackStack v1.21.3
44
55
.DESCRIPTION
66
Comprehensive non-interactive test suite covering:

0 commit comments

Comments
 (0)