我想要使用Powershell 5的PKI
模块中的各种命令:
$ Get-Command -module PKI
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Add-CertificateEnrollmentPolicyServer 1.0.0.0 PKI
Cmdlet Export-Certificate 1.0.0.0 PKI
Cmdlet Export-PfxCertificate 1.0.0.0 PKI
Cmdlet Get-Certificate 1.0.0.0 PKI
Cmdlet Get-CertificateAutoEnrollmentPolicy 1.0.0.0 PKI
Cmdlet Get-CertificateEnrollmentPolicyServer 1.0.0.0 PKI
Cmdlet Get-CertificateNotificationTask 1.0.0.0 PKI
Cmdlet Get-PfxData 1.0.0.0 PKI
Cmdlet Import-Certificate 1.0.0.0 PKI
Cmdlet Import-PfxCertificate 1.0.0.0 PKI
Cmdlet New-CertificateNotificationTask 1.0.0.0 PKI
Cmdlet New-SelfSignedCertificate 1.0.0.0 PKI
Cmdlet Remove-CertificateEnrollmentPolicyServer 1.0.0.0 PKI
Cmdlet Remove-CertificateNotificationTask 1.0.0.0 PKI
Cmdlet Set-CertificateAutoEnrollmentPolicy 1.0.0.0 PKI
Cmdlet Switch-Certificate 1.0.0.0 PKI
Cmdlet Test-Certificate 1.0.0.0 PKI
然而运行 Install-Module -Name PKI
返回:
No match was found for the specified search criteria and module name 'PKI'
有PSPKI
,但是它是一个第三方模块,并且具有不同的API和命令:
Get-Command -Module PSPKI
CommandType Name Version Source
----------- ---- ------- ------
Alias Add-AIA 3.3.0.0 PSPKI
Alias Add-CAACL 3.3.0.0 PSPKI
Alias Add-CDP 3.3.0.0 PSPKI
Alias Connect-CA 3.3.0.0 PSPKI
Alias Disable-CRLFlag 3.3.0.0 PSPKI
Alias Disable-KRAFlag 3.3.0.0 PSPKI
Alias Enable-CRLFlag 3.3.0.0 PSPKI
Alias Enable-KRAFlag 3.3.0.0 PSPKI
Alias Get-AIA 3.3.0.0 PSPKI
Alias Get-CA 3.3.0.0 PSPKI
Alias Get-CAACL 3.3.0.0 PSPKI
Alias Get-CDP 3.3.0.0 PSPKI
Alias Get-CRL 3.3.0.0 PSPKI
Alias Get-CRLFlag 3.3.0.0 PSPKI
Alias Get-CTL 3.3.0.0 PSPKI
Alias Get-KRAFlag 3.3.0.0 PSPKI
Alias Remove-AIA 3.3.0.0 PSPKI
Alias Remove-CAACL 3.3.0.0 PSPKI
Alias Remove-CDP 3.3.0.0 PSPKI
Alias Remove-Request 3.3.0.0 PSPKI
Alias Restore-CRLFlagDefault 3.3.0.0 PSPKI
Alias Restore-KRAFlagDefault 3.3.0.0 PSPKI
Alias Set-CAACL 3.3.0.0 PSPKI
Alias Set-CDP 3.3.0.0 PSPKI
Alias Show-CRL 3.3.0.0 PSPKI
Alias Show-CTL 3.3.0.0 PSPKI
Function Convert-PemToPfx 3.3.0.0 PSPKI
Function Convert-PfxToPem 3.3.0.0 PSPKI
Function Get-CertificateContextProperty 3.3.0.0 PSPKI
Function Get-CertificateRequest 3.3.0.0 PSPKI
Function Get-CertificateRevocationList 3.3.0.0 PSPKI
Function Get-CertificateTrustList 3.3.0.0 PSPKI
Function Get-CryptographicServiceProvider 3.3.0.0 PSPKI
Function Get-EnrollmentPolicyServerClient 3.3.0.0 PSPKI
Function Get-ErrorMessage 3.3.0.0 PSPKI
Function Get-ObjectIdentifier 3.3.0.0 PSPKI
Function Get-ObjectIdentifierEx 3.3.0.0 PSPKI
Function New-SelfSignedCertificateEx 3.3.0.0 PSPKI
Function Ping-ICertInterface 3.3.0.0 PSPKI
Function Receive-Certificate 3.3.0.0 PSPKI
Function Register-ObjectIdentifier 3.3.0.0 PSPKI
Function Show-Certificate 3.3.0.0 PSPKI
Function Show-CertificateRevocationList 3.3.0.0 PSPKI
Function Show-CertificateTrustList 3.3.0.0 PSPKI
Function Start-PsFCIV 3.3.0.0 PSPKI
Function Submit-CertificateRequest 3.3.0.0 PSPKI
Function Test-WebServerSSL 3.3.0.0 PSPKI
Function Unregister-ObjectIdentifier 3.3.0.0 PSPKI
如何在 Powershell Core 6 上安装 PKI
模块?
New-SelfSignedCertificate
但是得到了相同的错误。不过感谢找到该模块并提供导入语句。 - Colin