Huh, I somehow misremember that Powershell has a way to interface with random C APIs then... Quick googling shows up you can? https://devblogs.microsoft.com/scripting/use-powershell-to-interact-with-the-windows-api-part-1/