Skip to content

Commit c1828e3

Browse files
committed
v1.19.0 — Navigation + resilience sweep: 20 fixes across 21 modules
ReturnToMainMenu checks added to 17 menu loops (iSCSI, Firewall Templates, NTP, Disk Cleanup, BitLocker, ISO Download, Cluster Dashboard, VM Checkpoints, VM Export/Import, Network Diagnostics, Hyper-V Replica, Storage Backends x5, Settings). UNC path guards on disk space checks (VM Export, Checkpoints, Deployment). slmgr.vbs paths use $env:SystemRoot. Defender $threats scope fix. IPv6 disable error action corrected. Export VM cleanup adds Stop-Job. $Matches convention fix. Test-Path -LiteralPath in exit cleanup. Removed unused BITSPreferred variable.
1 parent 087927c commit c1828e3

23 files changed

Lines changed: 82 additions & 35 deletions

Changelog.md

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

3+
## v1.19.0
4+
5+
- **Bug Fix:** "Home" navigation now works from all nested menus — added `ReturnToMainMenu` checks to 17 menu loops across iSCSI, Firewall Templates, NTP, Disk Cleanup, BitLocker, ISO Download, Cluster Dashboard, VM Checkpoints, VM Export/Import, Network Diagnostics, Hyper-V Replica, Storage Backends, and Settings.
6+
- **Bug Fix:** Disk space pre-checks no longer fail on UNC/network paths — VM Export, VM Checkpoints, and VM Deployment now guard against non-drive-letter paths (clusters with CSVs, SMB shares).
7+
- **Bug Fix:** Hardcoded `slmgr.vbs` paths replaced with `$env:SystemRoot` for non-standard Windows installations (21-Licensing).
8+
- **Bug Fix:** Defender threat count logged correctly when query fails — `$threats` initialized before try block to prevent false "Threats=1" in session log (17-DefenderExclusions).
9+
- **Bug Fix:** IPv6 disable now reports actual failures instead of silent success — changed from `SilentlyContinue` to `Stop` error action so the catch block is reachable (07-IPConfiguration).
10+
- **Bug Fix:** Export VM cleanup now properly stops orphaned background jobs before removing them (53-VMExportImport).
11+
- **Bug Fix:** `$Matches` automatic variable captured immediately per project convention (19-NTPConfiguration).
12+
- **Bug Fix:** `Test-Path` calls use `-LiteralPath` for all constructed paths in exit cleanup to prevent wildcard interpretation (47-ExitCleanup).
13+
- **Cleanup:** Removed unused `$script:BITSPreferred` variable (00-Initialization).
14+
- 63 modules, 1853 tests
15+
316
## v1.18.2
417

518
- **Bug Fix:** HTML reports encode all dynamic values with `HtmlEncode` — VM names, adapter names, CPU model, process names, and config profile comparison data are now safe from display issues with special characters like `&`, `<`, `>` in generated HTML (54-HTMLReports).

Header.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,23 @@
3030
7h3 4b1d3r
3131
3232
.VERSION
33-
1.18.2
33+
1.19.0
3434
3535
.LAST UPDATED
3636
03/04/2026
3737
38+
.CHANGELOG v1.19.0
39+
NAVIGATION + RESILIENCE SWEEP — 20 FIXES:
40+
- FIX: "Home" navigation now works from all nested menus — added ReturnToMainMenu checks to 17 menu loops across iSCSI, Firewall Templates, NTP, Disk Cleanup, BitLocker, ISO Download, Cluster Dashboard, VM Checkpoints, VM Export/Import, Network Diagnostics, Hyper-V Replica, Storage Backends, and Settings
41+
- FIX: Disk space pre-checks no longer fail on UNC/network paths — VM Export, VM Checkpoints, and VM Deployment now guard against non-drive-letter paths (clusters with CSVs, SMB shares)
42+
- FIX: Hardcoded slmgr.vbs paths replaced with $env:SystemRoot for non-standard Windows installations (Licensing)
43+
- FIX: Defender threat count logged correctly when query fails — $threats initialized before try block to prevent false "Threats=1" in session log (Defender Exclusions)
44+
- FIX: IPv6 disable now reports actual failures instead of silent success — changed from SilentlyContinue to Stop error action (IP Configuration)
45+
- FIX: Export VM cleanup now properly stops orphaned background jobs before removing them (VM Export/Import)
46+
- FIX: $Matches automatic variable captured immediately per project convention (NTP Configuration)
47+
- FIX: Test-Path calls use -LiteralPath for all constructed paths in exit cleanup to prevent wildcard interpretation (Exit Cleanup)
48+
- CLEANUP: Removed unused $script:BITSPreferred variable (Initialization)
49+
3850
.CHANGELOG v1.18.2
3951
ROBUSTNESS + CONSISTENCY SWEEP — 14 FIXES:
4052
- FIX: HTML reports encode all dynamic values — VM names, adapter names, CPU model, process names, and config profile comparison data now use HtmlEncode to prevent display issues with special characters like & < > in generated HTML (54-HTMLReports)

Modules/00-Initialization.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ $script:FeatureInstallTimeoutSeconds = 1800 # 30 minutes max for Windows Featur
3232
$script:LargeFileDownloadTimeoutSeconds = 3600 # 1 hour for ISO/VHD downloads
3333
$script:DefaultDownloadTimeoutSeconds = 1800 # 30 minutes for standard downloads
3434
$script:MaxDownloadRetries = 3 # Max retry attempts for large file downloads (>500MB)
35-
$script:BITSPreferred = $true # Use BITS transfer when available (supports native resume)
3635
# Configurable MSP agent installer (override via defaults.json AgentInstaller)
3736
$script:AgentInstaller = @{
3837
ToolName = "MSP"
@@ -135,7 +134,7 @@ if (-not $script:ModuleRoot) { $script:ModuleRoot = $PSScriptRoot }
135134
if (-not $script:ModuleRoot -and $script:ScriptPath) {
136135
$script:ModuleRoot = [System.IO.Path]::GetDirectoryName($script:ScriptPath)
137136
}
138-
$script:ScriptVersion = "1.18.2"
137+
$script:ScriptVersion = "1.19.0"
139138
$script:ScriptStartTime = Get-Date
140139

141140
# OS version detection (for feature compatibility)

Modules/07-IPConfiguration.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ function Disable-AllIPv6 {
444444

445445
foreach ($adapter in $adapters) {
446446
try {
447-
Disable-NetAdapterBinding -Name $adapter.Name -ComponentID ms_tcpip6 -ErrorAction SilentlyContinue
447+
Disable-NetAdapterBinding -Name $adapter.Name -ComponentID ms_tcpip6 -ErrorAction Stop
448448
$successCount++
449449
Write-OutputColor "Disabled IPv6 on $($adapter.Name)" -color "Success"
450450
}

Modules/10-iSCSI.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,7 @@ function Show-iSCSISANMenu {
12461246
# Function to run iSCSI & SAN Management menu
12471247
function Start-Show-iSCSISANMenu {
12481248
while ($true) {
1249+
if ($global:ReturnToMainMenu) { return }
12491250
$choice = Show-iSCSISANMenu
12501251

12511252
$navResult = Test-NavigationCommand -UserInput $choice

Modules/17-DefenderExclusions.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ function Show-DefenderStatus {
439439
Write-OutputColor "" -color "Info"
440440

441441
# Threat detection history
442+
$threats = @()
442443
try {
443444
$threats = @(Get-MpThreatDetection -ErrorAction Stop)
444445
if ($threats.Count -gt 0) {

Modules/18-FirewallTemplates.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Function to apply firewall rule templates
33
function Set-FirewallRuleTemplates {
44
while ($true) {
5+
if ($global:ReturnToMainMenu) { return }
56
Clear-Host
67
Write-OutputColor "" -color "Info"
78
Write-OutputColor " ╔════════════════════════════════════════════════════════════════════════╗" -color "Info"

Modules/19-NTPConfiguration.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Function to configure NTP time servers
33
function Set-NTPConfiguration {
44
while ($true) {
5+
if ($global:ReturnToMainMenu) { return }
56
Clear-Host
67
Write-OutputColor "" -color "Info"
78
Write-OutputColor " ╔════════════════════════════════════════════════════════════════════════╗" -color "Info"
@@ -161,7 +162,8 @@ function Show-DetailedTimeStatus {
161162

162163
# Parse phase offset (in seconds)
163164
if ($lineStr -match 'Phase Offset:\s*([\-\d\.]+)s') {
164-
$offsetSeconds = [double]$Matches[1]
165+
$regexMatches = $matches
166+
$offsetSeconds = [double]$regexMatches[1]
165167
}
166168
}
167169
}

Modules/20-DiskCleanup.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Function to run disk cleanup
33
function Start-DiskCleanup {
44
while ($true) {
5+
if ($global:ReturnToMainMenu) { return }
56
Clear-Host
67
Write-OutputColor "" -color "Info"
78
Write-OutputColor " ╔════════════════════════════════════════════════════════════════════════╗" -color "Info"

Modules/21-Licensing.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function Get-WindowsVersionInfo {
9696
# Function to check if server is activated
9797
function Test-ServerActivated {
9898
try {
99-
$result = cscript.exe //NoLogo C:\Windows\System32\slmgr.vbs /dli 2>&1
99+
$result = cscript.exe //NoLogo "$env:SystemRoot\System32\slmgr.vbs" /dli 2>&1
100100
$resultText = $result -join "`n"
101101

102102
if ($resultText -match "License Status: Licensed") {
@@ -132,7 +132,7 @@ function Enable-ServerActivation {
132132
}
133133

134134
Write-OutputColor "Installing product key..." -color "Info"
135-
$ipkResult = cscript.exe //NoLogo C:\Windows\System32\slmgr.vbs /ipk "$productKey" 2>&1
135+
$ipkResult = cscript.exe //NoLogo "$env:SystemRoot\System32\slmgr.vbs" /ipk "$productKey" 2>&1
136136
$ipkText = $ipkResult -join ' '
137137

138138
if ($ipkText -notmatch "(?i)success") {
@@ -153,7 +153,7 @@ function Enable-ServerActivation {
153153

154154
Write-OutputColor " Key installed. Activating..." -color "Info"
155155
Start-Sleep -Seconds 5
156-
$activateResult = cscript.exe //NoLogo C:\Windows\System32\slmgr.vbs /ato 2>&1
156+
$activateResult = cscript.exe //NoLogo "$env:SystemRoot\System32\slmgr.vbs" /ato 2>&1
157157
$atoText = $activateResult -join ' '
158158

159159
if ($atoText -match "(?i)success") {

0 commit comments

Comments
 (0)