Closed animentork closed 1 year ago
Thanks for reporting this and you are absolutely correct. The fact that the SeverityOverride
exists in this package but doesn't contain any child nodes caused the error. I was able to reproduce this with Get-LSUpdate -Model 20DT
for example.
I've pushed fa5e1ff to the develop branch which fixes this and will be included in the next release of LSUClient, likely 1.5.1
Great, thanks! Do you know if those XML elements ever contain any child nodes? I thought they only have their type
attributes. If there were never any child nodes, the if statement would never be true.
Yes, in fact SeverityOverride is usually either missing entirely or contains child nodes defining the tests for when the override is supposed to be applied like in this Intel Bluetooth Driver:
<Severity type="1"/>
<SeverityOverride type="2">
<Not>
<_Driver>
<HardwareID>
<![CDATA[ USB\VID_8087&PID_0029 ]]>
</HardwareID>
<Version>0.1^</Version>
</_Driver>
</Not>
</SeverityOverride>
The case you have found here where it exists, has a type
defined, but is otherwise empty must be fairly rare as this is the first time this error has been reported. It's possibly even a one-off mistake / broken package on Lenovos part.
That being said, there's also plenty of packages where the "base-Severity" is identical to the SeverityOverride, like in this Synaptics FingerPrint driver:
<Severity type="2"/>
<SeverityOverride type="2">
<Not>
<_Driver>
<HardwareID>
<![CDATA[ USB\VID_06CB&PID_00BD ]]>
</HardwareID>
<HardwareID>
<![CDATA[ USB\VID_06CB&PID_00C2 ]]>
</HardwareID>
<HardwareID>
<![CDATA[ USB\VID_06CB&PID_0123 ]]>
</HardwareID>
<Version>0.1^</Version>
</_Driver>
</Not>
</SeverityOverride>
which also doesn't quite make sense to me, so it's entirely possible I've been misinterpreting the meaning of Severity vs SeverityOverride. But I don't have a better guess yet š
Published Version 1.5.1 which includes this fix
Version
1.5.0
Computer Model
all
Problem
This line in Get-LSUpdate.ps1 produces an error with some drivers:
if (Resolve-XMLDependencies -XMLIN $packageXML.Package.SeverityOverride -TreatUnsupportedAsPassed:$true -PackagePath $LocalPackageRoot -FailInboxDrivers) {
Error:
PS>TerminatingError(Resolve-XMLDependencies): "Cannot validate argument on parameter 'XMLIN'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again."
Steps to reproduce:
Here is a shortened example of such a driver XML file, save it as j5ia09ww2.xml:
Define the following test function:
You can provoke the error as follows:
Error:
PS>TerminatingError(Resolve-XMLDependencies): "Cannot validate argument on parameter 'XMLIN'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again."
Cause:
I think it's because Severity and SeverityOverride are always "empty" from PowerShell's perspective. It has an XML attribute:
But it's empty:
I think that's why the validation in the parameters of Resolve-XMLDependencies raises the error!
Additional context
No response