Код:
#include<array.au3>
_ArrayDisplay(_GetCert())
Func _GetCert()
$psLine = "$MyCerts = dir Cert:\LocalMachine\My; Foreach($MyCert in $MyCerts) { $MyCert.SerialNumber; $MyCert.PrivateKey.CspKeyContainerInfo.UniqueKeyContainerName; }"
$iPID = Run(@ComSpec & " /c Powershell " & $psLine, "", @SW_HIDE , $stdout_child)
$sOutput = ""
While 1
$sOutput &= StdoutRead($iPID)
If @error Then
ExitLoop
EndIf
WEnd
$aRtn = stringsplit($sOutput , @LF , 2)
_ArrayDelete($aRtn , ubound($aRtn) - 1)
If ubound($aRtn) < 1 then _ArrayAdd($aRtn , "No Match Found")
Return $aRtn
EndFunc