How to automate HLK tests using powershell or C#

Hello, NTDEV!
I want to automate HLK tests as they take me so much time.
I found C# and PowerShell examples here https://docs.microsoft.com/en-us/windows-hardware/test/hlk/developer/hello-world, but when I launched it in my project I got so many errors:
C#
using Microsoft.Windows.Kits.Hardware.ObjectModel;
using Microsoft.Windows.Kits.Hardware.ObjectModel.DBConnection;
using Microsoft.Windows.Kits.Hardware.ObjectModel.Submission;

error CS0234: The type or namespace name ‘Windows’ does not exist in the namespace ‘Microsoft’

PowerShell
$ObjectModel = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + “Microsoft.Windows.Kits.Hardware.objectmodel.dll”)
$ObjectModel = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + “Microsoft.Windows.Kits.Hardware.objectmodel.dbconnection.dll”)
$ObjectModel = [Reflection.Assembly]::LoadFrom($env:WTTSTDIO + “Microsoft.Windows.Kits.Hardware.objectmodel.submission.dll”)
Could not load file or assembly or one of its dependencies. The specified file cannot be found.

What’s wrong?

Cannot tell about C#, I’ve never tried it. With PowerShell you need to make sure, that you are using the correct architecture. For HLK you have to run the 64-bit version of PowerShell; for HCK it must be the 32-bit version.

Take a look at this project:
https://github.com/HCK-CI/toolsHCK
It is used as a part of AutoHCK toolset designed for automated HCK/HLK test runs. This toolsHCK script is installed and launched on the Controller system; it then waits for commands to be sent into it, and performs them (like creating a project, a pool, adding tests, etc.).