Automate HLK testing driver

Hello, NTDEV!
I’m developing project to automate HLK test. So I have a question how to choose tests for my driver. I have:

$Project = $manager.CreateProject(“My project”)
$ProductInstance = $Project.CreateProductInstance(“My Product Instance”, $Pool, $OSPlatform)

So what is next? What target should I choose and how? When I signed drivers manually I checked my driver in the list on software device tab.

You can use Machine.GetTestTargets() for obtaining all the available targets on the machine from your pool, enumerate them, and identify the one you need by the driver name (for non-PNP devices) or device identifier (for PNP). At least, this is what AutoHCK does. :slight_smile:

1 Like

@CaptainFlint said:
You can use Machine.GetTestTargets() for obtaining all the available targets on the machine from your pool, enumerate them, and identify the one you need by the driver name (for non-PNP devices) or device identifier (for PNP). At least, this is what AutoHCK does. :slight_smile:

Thank you a lot! And now I have another question… I want to add folders with my .sys driver files and also folder with symbols. I tried this way:

$Package = new-object -typename Microsoft.Windows.Kits.Hardware.ObjectModel.Submission.PackageWriter -args $Project
$Package.AddDriver(“C:\Users\ksenya\Documents\win10\x64\driver”, “C:\Users\ksenya\Documents\win10\x64\driver\pdb”, $Target, “English”, $errors, $warnings)

But I got a mistake Cannot find an overload for “AddDriver” and the argument count: “6”. What am I doing wrong?(

I call it like that:

$localeList = ([Microsoft.Windows.Kits.Hardware.ObjectModel.ProjectManager]::GetLocaleList())
$PackageWriter.AddDriver($drivers, $symbols, $targets.AsReadOnly(), $localeList, [ref] $errorMessages, [ref] $warningMessages)

Not 100% sure what exactly is wrong in your variant, and right now I don’t have time to experiment, but a) maybe locale is not just a string, but an object; b) errors and warnings are output, so they need to be passed as ref; c) not sure if AsReadOnly() makes any difference for the targets, but I’d try that too, it was like that in the early version of toolsHCK I’ve adopted.