C# PowerShell-X509Certificates.X509Store是否获取所有证书?

C# PowerShell-X509Certificates.X509Store是否获取所有证书?,c#,.net,powershell,C#,.net,Powershell,我想从我的系统中获取所有证书。 所以我使用了System.Security.Cryptography.X509Certificates类。 当我在X509Store之后删除()时,我得到的结果与我输入的“我的” 查看所有证书的正确成员名是什么?有可能吗 您可以从本地证书驱动器获取: Get-ChildItem Cert:\CurrentUser\CA # user certs Get-ChildItem Cert:\LocalMachine\CA # machine certs 如果安装了

我想从我的系统中获取所有证书。 所以我使用了
System.Security.Cryptography.X509Certificates类。
当我在
X509Store
之后删除
()
时,我得到的结果与我输入的
“我的”

查看所有证书的正确成员名是什么?有可能吗


您可以从本地证书驱动器获取:

Get-ChildItem Cert:\CurrentUser\CA # user certs

Get-ChildItem Cert:\LocalMachine\CA # machine certs
如果安装了WinRM,这很有趣,但以更标准的方式查找所有证书,最好使用

$store = New-Object System.Security.Cryptography.X509Certificates.X509Store("\\$server_name\My","LocalMachine")

$store.Open("ReadOnly")             
$store.Certificates
Get-ChildItem Cert:\LocalMachine\My
$store = New-Object System.Security.Cryptography.X509Certificates.X509Store("\\$server_name\My","LocalMachine")

$store.Open("ReadOnly")             
$store.Certificates