-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRackStack.ps1
More file actions
141 lines (125 loc) · 4.05 KB
/
RackStack.ps1
File metadata and controls
141 lines (125 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<#
.SYNOPSIS
RackStack - Modular Loader (Development)
.DESCRIPTION
This is the MODULAR LOADER -- it dot-sources all 65 modules from the Modules/
subfolder and starts RackStack. Use this file for development and testing.
This is NOT the monolithic build. The monolithic single-file version is:
RackStack v{version}.ps1 (generated by sync-to-monolithic.ps1)
The .exe is compiled from the monolithic, not from this loader.
Environment-specific settings are configured via defaults.json.
.VERSION
1.94.1
.NOTES
- Requires Windows Server 2012 R2 or later (or Windows 10/11 for testing)
- Must be run as Administrator
- All modules are loaded from the Modules subfolder
- For production deployment, use the monolithic .ps1 or the compiled .exe
#>
#Requires -Version 5.1
# Get the script's directory
$script:ModuleRoot = $PSScriptRoot
# Verify running as administrator - auto-elevate if not
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "This script requires administrative privileges. Restarting with elevation..." -ForegroundColor Yellow
Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
}
# Define module load order (dependencies first)
$moduleFiles = @(
"00-Initialization.ps1"
"01-Console.ps1"
"02-Logging.ps1"
"03-InputValidation.ps1"
"04-Navigation.ps1"
"05-SystemCheck.ps1"
"06-NetworkAdapters.ps1"
"07-IPConfiguration.ps1"
"08-VLAN.ps1"
"09-SET.ps1"
"10-iSCSI.ps1"
"11-Hostname.ps1"
"12-DomainJoin.ps1"
"13-Timezone.ps1"
"14-WindowsUpdates.ps1"
"15-RDP.ps1"
"16-Firewall.ps1"
"17-DefenderExclusions.ps1"
"18-FirewallTemplates.ps1"
"19-NTPConfiguration.ps1"
"20-DiskCleanup.ps1"
"21-Licensing.ps1"
"22-Password.ps1"
"23-LocalAdmin.ps1"
"24-DisableAdmin.ps1"
"25-HyperV.ps1"
"26-MPIO.ps1"
"27-FailoverClustering.ps1"
"28-PerformanceDashboard.ps1"
"29-EventLogViewer.ps1"
"30-ServiceManager.ps1"
"31-BitLocker.ps1"
"32-Deduplication.ps1"
"33-StorageReplica.ps1"
"34-Help.ps1"
"35-Utilities.ps1"
"36-BatchConfig.ps1"
"37-HealthCheck.ps1"
"38-StorageManager.ps1"
"39-FileServer.ps1"
"40-HostStorage.ps1"
"41-VHDManagement.ps1"
"42-ISODownload.ps1"
"43-OfflineVHD.ps1"
"44-VMDeployment.ps1"
"45-ConfigExport.ps1"
"46-SessionSummary.ps1"
"47-ExitCleanup.ps1"
"48-MenuDisplay.ps1"
"49-MenuRunner.ps1"
"50-EntryPoint.ps1"
"51-ClusterDashboard.ps1"
"52-VMCheckpoints.ps1"
"53-VMExportImport.ps1"
"54-HTMLReports.ps1"
"55-QoLFeatures.ps1"
"56-OperationsMenu.ps1"
"57-AgentInstaller.ps1"
"58-NetworkDiagnostics.ps1"
"59-StorageBackends.ps1"
"60-ServerRoleTemplates.ps1"
"61-ActiveDirectory.ps1"
"62-HyperVReplica.ps1"
"63-ScheduledTasks.ps1"
"64-SystemDebloat.ps1"
)
# Load all modules
$modulesPath = Join-Path $script:ModuleRoot "Modules"
Write-Host "Loading configuration tool modules..." -ForegroundColor Cyan
$loadedCount = 0
$errorCount = 0
foreach ($module in $moduleFiles) {
$modulePath = Join-Path $modulesPath $module
if (Test-Path $modulePath) {
try {
. $modulePath
$loadedCount++
}
catch {
Write-Host " ERROR loading $module : $_" -ForegroundColor Red
$errorCount++
}
}
else {
Write-Host " WARNING: Module not found: $module" -ForegroundColor Yellow
$errorCount++
}
}
if ($errorCount -gt 0) {
Write-Host "`nLoaded $loadedCount modules with $errorCount errors." -ForegroundColor Yellow
Write-Host "Some functionality may be unavailable." -ForegroundColor Yellow
Read-Host "Press Enter to continue anyway, or Ctrl+C to exit"
}
# Start the tool (calls Assert-Elevation which handles transcript and launches menu)
Assert-Elevation