【问题标题】:New-SelfSignedCertificate will not run on Windows 7New-SelfSignedCertificate 不会在 Windows 7 上运行
【发布时间】:2020-04-24 16:17:02
【问题描述】:

在 Windows 7 Professional 系统上,似乎无法运行 New-SelfSignedCertificate。我可以在 Windows 10 系统上。

是的,shell 以“以管理员身份运行”启动。

PS C:\> new-selfsignedcertificate
new-selfsignedcertificate : The term 'new-selfsignedcertificate' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
+ new-selfsignedcertificate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (new-selfsignedcertificate:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      0      10586  117

【问题讨论】:

  • 正确。 New-SelfSignedCertificate cmdlet 是 Windows 10 附带的 PKIClient module 的一部分
  • 看来对于Windows 7,开发者必须去微软获取makecert.exe
  • 已确认 New-SelfSignedCertificate 在 Windows 8.1 Pro 上运行。我们正在使用它来生成我们的自签名证书。

标签: powershell


【解决方案1】:

如上面的 cmets 所述,这在 Windows 7 中不可用。

但是,如果您正在寻找具有类似 API 和功能的东西,那么我已经使用过并且可以从 Microsoft 脚本中心推荐这个:

https://gallery.technet.microsoft.com/scriptcenter/self-signed-certificate-5920a7c6

【讨论】:

  • 听起来不错,但我想坚持使用已弃用的 makecert 以在已弃用的 Windows 7 系统上使用。
【解决方案2】:

必须安装 AzureRM 模块才能通过 powershell 使用 azure 命令。你可以使用下面的命令来做到这一点。

Install-Module -Name AzureRM -AllowClobber

【讨论】:

    猜你喜欢
    • 2022-12-20
    • 2018-03-19
    • 2017-11-29
    • 1970-01-01
    • 2016-06-25
    • 1970-01-01
    • 2011-06-02
    • 1970-01-01
    • 2011-12-01
    相关资源
    最近更新 更多