10 lines
677 B
PowerShell

$certificate = # The certificate from the certificate chain
$isLeafCertificate = 'true'
$isRootCertificate = 'false'
$hostBasedSetupServiceRef = $wsmanConnectionObject.NewReference("SELECT * FROM IPS_HostBasedSetupService WHERE Name='Intel(r) AMT Host Based Setup Service'")
$inputObject = $hostBasedSetupServiceRef.CreateMethodInput("AddNextCertInChain")
$inputObject.SetProperty("NextCertificate", $certificate)
$inputObject.SetProperty("IsLeafCertificate", $isLeafCertificate)
$inputObject.SetProperty("IsRootCertificate", $isRootCertificate)
$outputObject = $hostBasedSetupServiceRef.InvokeMethod($inputObject)
$returnValue = $outputObject.GetProperty("ReturnValue")