OSDeploy / OSDCloud

OSDCloud is a process to fully deploy a Windows OS from a WinPE Environment
https://osdcloud.osdeploy.com
63 stars 14 forks source link

Get-MyDriverPack and Dell Driverpacks Don't Work Right #36

Closed BaddMann closed 7 months ago

BaddMann commented 7 months ago

Get-MyDriverPack by default just grabs the latest driver for the device model, Unfortunately Dell is now presenting windows 11 Drivers that can break windows 10 on a few select models. I've learn this lesson the hard way.

I've modified the function a bit, but it's really just a hack, maybe you can come up with a more elegant solution?

`function Get-MyDriverPack { [CmdletBinding()] param ( [System.String]$Manufacturer = (Get-MyComputerManufacturer -Brief), [System.String]$Product = (Get-MyComputerProduct) )

=================================================

#   Set ErrorActionPreference
#=================================================
$ErrorActionPreference = 'SilentlyContinue'
#=================================================
#   Determine OS Version
#=================================================
$OSVersion = (Get-CimInstance Win32_OperatingSystem).Version
$TargetOS = if ($OSVersion -like "10.*") { "Windows 10 x64" } elseif ($OSVersion -like "10.0.22*") { "Windows 11 x64" } else { "Unsupported OS" }
#=================================================
#   Action
#=================================================
$Results = Get-OSDCloudDriverPacks | Where-Object {
    ($_.Product -contains $Product) -and ($_.OS -eq $TargetOS)
}
#=================================================
#   Results
#=================================================
if ($Results) {
    $Results = $Results | Sort-Object -Property Name -Descending
    $Results[0]
}
else {
    Write-Verbose "$Manufacturer $Product is not supported or no matching driver pack for current OS"
}
#=================================================

}`

BaddMann commented 7 months ago

Sorry wrong repo, needs to be in OSD