我试图在PowerShell中使用Install-Module Azure
来安装Azure。我得到了以下错误。
PS C:\Windows\system32> Install-Module Azure
Install-Module : The term 'Install-Module' 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 corre
ct and try again.
At line:1 char:1
+ Install-Module Azure
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
为什么PS不能识别基本安装模块?没有这个,我甚至不能安装Azure。我应该怎么做?
由于你使用的是低版本的PS。
在你的情况下,你可以做的是你首先在你的本地文件夹中下载该模块。
然后,在该文件夹下会有一个.psm1文件,用于该模块。
你只要
import-Module "文件.psm1的路径"。
以下是下载Azure模块的链接。 Azure Powershell。
这将完成你的工作。
你应该安装最新版本的PowerShell,然后使用这个命令Install-Module Azure
来安装azure模块。因为从Powershell 5.0开始,你,你将能够使用cmdlet来安装-模块,保存-模块。
PS > $psversiontable
Name Value
---- -----
PSVersion 5.1.14393.576
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.576
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
更多关于安装Azure的信息PowerShell,请参考链接。
如果你试图安装一个列在PS内容中央仓库的模块,称为PowerShell Gallery,你需要安装PowerShellGet。然后该命令就可以使用了。我目前使用的是PS 4.0。安装PowerShellGet对我来说很有帮助。
来源:
使用最新的PowerShellGet模块,你可以。
[另一篇关于PS图库入门的好文章][2]