Using the WHQL Powershell API, how would I add a Filter.Driver.FileSystem feature to a target

Richard Parker 0 Reputation points
2023-08-28T13:37:38.0733333+00:00

I have a software driver I am trying to automate the WHQL testing on. Manually I would click on Selection->Software Device->select the machine pool->search for driver and check it. Then I would right-click driver and 'Add/Modify Features' and add Filter.Driver.FileSystem.

I have a product instance ($productInstance) where I can GetFeatures() and see it has 3(DeviceGuard, Fundamentals, Security) which are already selected in the manual step above, however I need to also add the FileSystem one to this list. Looking at the API documents I see an AddFeature() which is used to 'add a feature'. It takes a 'Feature' but I can't seem to create a new Feature of type Filter.Driver.FileSystem. to call AddFeature with.

Example:


The last 2 lines don't work, but show what I am trying to do. I get a constructor not found exception:

(exception: A constructor was not found. Cannot find an appropriate constructor for type Microsoft.Windows.Kits.Hardware.ObjectModel.Feature. )

I call $ObjectModel = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + "microsoft.windows.Kits.Hardware.objectmodel.dll") earlier in the code and am able to do things like

[Microsoft.Windows.Kits.Hardware.ObjectModel.ProductInstance]$productInstance = $null

in a parameter statement earlier etc so I know that is loaded.

Any assistance on adding the Filter.Driver.FileSystem feature to my target would be appreciated.

Thank you very much,

Rich Parker

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,812 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.