【发布时间】:2017-06-03 18:35:17
【问题描述】:
Powershell 通过以下方式提供对 Windows 7 机器上证书的访问:
PS C:\Users\z0017fjy> cd cert:
PS cert:\> dir
Location : CurrentUser
StoreNames : {SmartCardRoot, UserDS, AuthRoot, CA...}
Location : LocalMachine
StoreNames : {SmartCardRoot, AuthRoot, CA, Trust...}
PS cert:\> cd .\LocalMachine
PS cert:\LocalMachine> dir
Name : SmartCardRoot
Name : AuthRoot
Name : CA
Name : Trust
Name : Disallowed
Name : SMS
Name : My
Name : Root
Name : TrustedPeople
Name : TrustedDevices
Name : Remote Desktop
Name : TrustedPublisher
Name : REQUEST
现在我想使用以下伪代码遍历 cert 文件夹:
for each subfolder in cert:
for each certstore in subfolder:
for each cert in certstore:
print cert.information
我将如何在 powershell 中做到这一点?
【问题讨论】:
-
你试过
Get-ChildItem -Recurse Cert:\吗? -
我已经试过了。看起来不错!请将其作为正确答案发布,以便我接受。
标签: windows powershell certificate