【发布时间】:2011-10-05 09:31:53
【问题描述】:
我在运行 system.security 命名空间时收到此错误。这就是我追求的目标
$cert=New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\mycert.cer")
New-Object: Cannot find type [System.Security.Cryptography.X509Certificates.X509Certificate2("C:\mycert.cer")]: make sure the assembly containing this type is loaded.
At line:1 char:19
+ $cert = New-Object <<<<
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand**
我做错了什么?
【问题讨论】:
-
命令看起来没问题。我无法重现 PowerShell v1 或 v2 中的错误。
标签: security powershell certificate x509certificate x509