在 Powershell 中安装 Az 模块时出错 - 无法安装包 'Az.Accounts'

Error while install Az module in Powershell - Package 'Az.Accounts' failed to be installed

我在 Windows 10 的 Powershell 中安装 Az 模块时遇到错误消息。有什么想法吗?

使用的命令:

Install-Module Az -AllowClobber

错误信息:

Package 'Az.Accounts' failed to be installed because: End of Central Directory record could not be found.

如评论所述,只需用管理员重新打开powershell即可。