Open EvilerBetty opened 5 years ago
Oh hell dell is starting to make me crazy
Biggest problem with this is the driver pack wont update. Since the Version number never changes. Workaround could be as easy as changing Version number to 0.
The problem is this bit of code: (($DriverCab).Split("-")[2]).Trim(".cab") 2-in-1 cab files have additional dashes (-) so it kinda screws With the versioning.
Example: (("FOLDER05672009M/1/5290 2-IN-1-Win10-A09-8FY5R.CAB").split("-")[2]).Trim(".cab") (("FOLDER05822961M/1/WinPE10.0-Drivers-A15-FYCJR.CAB").split("-")[2]).Trim(".cab") (("FOLDER05323227M/1/WinPE3.0-Drivers-A23-MJ53D.CAB").split("-")[2]).Trim(".cab")
Results: 1 A15 A23
If you replace the line:
$DriverRevision = (($DriverCab).Split("-")[2]).Trim(".cab")
With something like
$DriverRevision = ($global:DellModelCabFiles | Where-Object {((($_.SupportedOperatingSystems).OperatingSystem).osCode -match "Windows10") -and ($_.SupportedSystems.Brand.Model.SystemID -match "081D")} | Select-Object -Last 1).dellVersion
I think thats all that would be needed, but im not really familiar with the code or why things are done as they are.
+1 on this issue. my change is probably too simplistic though!
IF ( $DriverCab -like "*2-in-1* ) { $DriverRevision = (($DriverCab).Split("-")[4]).Trim(".cab") } Else { $DriverRevision = (($DriverCab).Split("-")[2]).Trim(".cab") }
We're only dealing with Dell hardware and Windows 10 so I've probably broken a bunch of other functions!
EDIT - I didn't like that so changed to:
$DriverRevision = (($DriverCab).Split("-")[((($DriverCab).Split("-")).count) - 2]).Trim(".cab")
Still entirely possible it will cause other issues, but its working for now!
I like the solution suggested by @Alslinet, but unless that's the only model you have, it'll think that every Dell model has that same version.
If you instead replace $DriverRevision = (($DriverCab).Split("-")[2]).Trim(".cab")
with something like $DriverRevision = ($Global:DellModelCabFiles | Where-Object {(($_.path).Split("/") | Select-Object -Last 1) -match $DriverCab}).dellVersion
it should scale better.
This is tested and working for me. All 14 Dell models now/still have the correct version number.
@skywayskase, you are right, i forgot to add that part in before posting. Then realized i would need som further changes. Here is the code. You should be able to identify which part of the script it is that has changed from this. I commented the parts that are changed.
I really need to learn how to do pull requests, see this pastebin for the changes i think will fix this, its the same fix, just for every model this time, should be anyway: https://pastebin.com/ZSAZUUMC
It looks as though Dell is listing some of the driver pack releases as "Version 1.0, A13". Example: http://downloads.dell.com/published/pages/latitude-12-5290-2-in-1-laptop.html
This results in the Driver Package version being set as "1" when imported into SCCM.