最近,我尝试按照微软的手册为Azure Service Factory创建自签名证书:
Azure Docs: Secure a Service Fabric cluster, step 2.5, 02/05/2016
但是命令 Invoke-AddCertToKeyVault 失败并出现下一个错误:
Invoke-AddCertToKeyVault : The term 'Invoke-AddCertToKeyVault' 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.
我认为 Azure Powershell 已成功安装在我的机器上,因为我能够通过运行 Login-AzureRmAccount 登录到我的 Azure 帐户。此外 $env:PSModulePath 表示 Azure 模块路径已添加到路径变量(根据文章:Azure Docs: How to install and configure Azure PowerShell, 04/22/2016)。他们在这里:
...\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\;
...\Microsoft SDKs\Azure\PowerShell\ServiceManagement\;
...\Microsoft SDKs\Azure\PowerShell\Storage\;
此外,我在安装 Azure PowerShell 后重新启动了我的电脑。
我可能错过了什么,但我坚持了下来。如何解决?
最佳答案
那个 commandlet 在应该导入的包中 -
Import-Module "C:\Users\chackdan\Documents\GitHub\Service-Fabric\Scripts\ServiceFabricRPHelpers\ServiceFabricRPHelpers.psm1"
那是它的implementation ,顺便说一下,它甚至存在的引用:)。试试 Import-Module,它应该可以工作。
关于windows - 使用 powershell Invoke-AddCertToKeyVault 命令创建 Azure 自签名证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37146448/