@@ -5,10 +5,12 @@ function Invoke-WinUtilISOScript {
55
66 . DESCRIPTION
77 Removes AppX bloatware and OneDrive, injects hardware drivers (NVMe, Precision
8- Touchpad/HID, and network) exported from the running system, applies offline
9- registry tweaks (hardware bypass, privacy, OOBE, telemetry, update suppression),
10- deletes CEIP/WU scheduled-task definition files, and optionally drops
11- autounattend.xml and removes the support\ folder from the ISO contents directory.
8+ Touchpad/HID, and network) exported from the running system, optionally injects
9+ extended Storage & Network drivers from the ChrisTitusTech/storage-lan-drivers
10+ repository (requires git, installed via winget if absent), applies offline registry
11+ tweaks (hardware bypass, privacy, OOBE, telemetry, update suppression), deletes
12+ CEIP/WU scheduled-task definition files, and optionally drops autounattend.xml and
13+ removes the support\ folder from the ISO contents directory.
1214 Mounting/dismounting the WIM is the caller's responsibility (e.g. Invoke-WinUtilISO).
1315
1416 . PARAMETER ScratchDir
@@ -44,7 +46,7 @@ function Invoke-WinUtilISOScript {
4446 . NOTES
4547 Author : Chris Titus @christitustech
4648 GitHub : https://github.com/ChrisTitusTech
47- Version : 26.02.25
49+ Version : 26.02.25b
4850 #>
4951 param (
5052 [Parameter (Mandatory )][string ]$ScratchDir ,
@@ -177,13 +179,64 @@ function Invoke-WinUtilISOScript {
177179 }
178180 }
179181
180- & $Log " Driver injection complete — $injected driver package(s) added."
182+ & $Log " Driver injection complete - $injected driver package(s) added."
181183 } catch {
182184 & $Log " Error during driver export/injection: $_ "
183185 } finally {
184186 Remove-Item - Path $driverExportRoot - Recurse - Force - ErrorAction SilentlyContinue
185187 }
186188
189+ # ── 2b. Optional: extended Storage & Network drivers from community repo ──
190+ $extDriverChoice = [System.Windows.MessageBox ]::Show(
191+ " Would you like to inject extended Storage and Network drivers?`n`n " +
192+ " This clones github.com/ChrisTitusTech/storage-lan-drivers and injects all " +
193+ " drivers from that repository into the image.`n`n " +
194+ " Git will be installed via winget if it is not already present." ,
195+ " Extended Drivers" , " YesNo" , " Question" )
196+
197+ if ($extDriverChoice -eq ' Yes' ) {
198+ & $Log " Extended driver injection requested."
199+
200+ # Ensure git is available
201+ $gitCmd = Get-Command git - ErrorAction SilentlyContinue
202+ if (-not $gitCmd ) {
203+ & $Log " Git not found — installing via winget..."
204+ winget install -- id Git.Git - e -- source winget `
205+ -- accept- package- agreements -- accept- source- agreements | Out-Null
206+ # Refresh PATH so git is visible in this session
207+ $env: PATH = [System.Environment ]::GetEnvironmentVariable(' PATH' , ' Machine' ) + ' ;' +
208+ [System.Environment ]::GetEnvironmentVariable(' PATH' , ' User' )
209+ $gitCmd = Get-Command git - ErrorAction SilentlyContinue
210+ }
211+
212+ if (-not $gitCmd ) {
213+ & $Log " Warning: git could not be found after install attempt — skipping extended drivers."
214+ } else {
215+ $extRepoDir = Join-Path $env: TEMP " WinUtil_ExtDrivers_$ ( Get-Random ) "
216+ try {
217+ & $Log " Cloning storage-lan-drivers repository..."
218+ & git clone -- depth 1 `
219+ " https://github.com/ChrisTitusTech/storage-lan-drivers" `
220+ $extRepoDir 2>&1 | ForEach-Object { & $Log " git: $_ " }
221+
222+ if (Test-Path $extRepoDir ) {
223+ & $Log " Injecting extended drivers into image (this may take several minutes)..."
224+ & dism / English " /image:$ScratchDir " / Add-Driver " /Driver:$extRepoDir " / Recurse 2>&1 |
225+ ForEach-Object { & $Log " dism: $_ " }
226+ & $Log " Extended driver injection complete."
227+ } else {
228+ & $Log " Warning: repository clone directory not found — skipping extended drivers."
229+ }
230+ } catch {
231+ & $Log " Error during extended driver injection: $_ "
232+ } finally {
233+ Remove-Item - Path $extRepoDir - Recurse - Force - ErrorAction SilentlyContinue
234+ }
235+ }
236+ } else {
237+ & $Log " Extended driver injection skipped."
238+ }
239+
187240 # ═════════════════════════════════════════════════════════════════════════
188241 # 3. Remove OneDrive
189242 # ═════════════════════════════════════════════════════════════════════════
0 commit comments