Discussion about this post

User's avatar
John Philipson's avatar

Hi Brady, really excellent article.

I just wondered, as I'm using a Windows 11 deployment - where the reference to "Windows 10 Device Provisioning Tool" can be edited to say "Windows 11 Device Provisioning Tool" or to actually use the correct tool ?

Expand full comment
Aaron Monson's avatar

I want to thank you for this.

I thought I would give you a heads up about an adjustment I did with the Drivers.

I adjusted it so it only grabbed the drivers for the current model of device. Lenovo is a bit different as it goes by a random deviceID rather than the actual name, but as long as you have the Device Name in the driver folder you can have all drivers for each model in your fleet.

#region Bootstrap drivers

$computerSystem = Get-CimInstance -ClassName Win32_ComputerSystem

$manufacturer = $computerSystem.Manufacturer

$model = $computerSystem.Model

Write-Host "`nDevice Model: " -ForegroundColor Yellow -NoNewline

Write-Host $model -ForegroundColor Cyan

# Determine the folder name based on the manufacturer

if ($manufacturer -eq "LENOVO") {

$folderName = $model.Substring(0, 4)

} else {

$folderName = $model

}

Write-Host "Using folder name: $folderName" -ForegroundColor Yellow

# Construct the path to the model-specific driver folder

$driverFolderPath = Join-Path -Path $usb.driverPath.FullName -ChildPath $folderName

# Get the drivers from the model-specific folder

$drivers = Get-ChildItem -Path $driverFolderPath -Filter *.inf -Recurse

if ($drivers) {

Write-Host "Bootstrapping found drivers into WinPE Environment.." -ForegroundColor Yellow

foreach ($d in $drivers) {

. drvload $d.FullName

}

} else {

Write-Host "No drivers detected in $driverFolderPath" -ForegroundColor Yellow

}

Expand full comment
53 more comments...

No posts