MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
628 stars 282 forks source link

Script errors when SKU in model is incorrect #302

Open MichaelGibsonAltrad opened 3 years ago

MichaelGibsonAltrad commented 3 years ago

When using either ApplyDriver 3.04 or 4.09 (We've just switched over), we've noticed that for at least the HP devices the script will error if the comments section is not as expected. The model below was created using DAT 6.49 (same with 6.5 BETA). As you can see the (Models included:) is blank, so the script errors as soon as it hits this. To fix it, I've just added the sku as 0 until we find out what it should be and the script continues.

Drivers - HP ProBook 650 G3 Notebook PC (ENERGY STAR) - Windows 10 2004 x64 (Models included:)

I've also noticed that some of the older packages repeated the SKU in this field e.g. (Models included:1111,2222,1111 2222,1111,2222) and when this happens, because you are using a hash table, it errors and crashes the script. Checking this field and fixing the problem entries allows the script to run again.

Thanks Michael

Ar5had07 commented 3 years ago

This should have been fixed long time ago. I remember correctly I faced the exact same problem and it was fixed by Nickolaj. Ans yeah another solution is to just populate the description.

MichaelGibsonAltrad commented 3 years ago

It must have crept back in then, as I've used the latest versions of the script. We've added a check into our process to run a debug from the command line after downloading drivers, but it would be good if this can be fixed again.