如何在Mac上使用POWESHELL的azures模块 [英] how to use the azures module of poweshell on a mac
本文介绍了如何在Mac上使用POWESHELL的azures模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从Mac Big Sur上PowerShell 7或7.1中的AzureAD模块访问一些cmdlet。
- 随Home-BREW安装PowerShell
- 使用来自Microsoft的PowerShell的扩展坞镜像
导入模块AzureAD时出现以下错误
Import-Module AzureAD Import-Module: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
经过一些研究,似乎MacOS目前不支持上述两种情况。
其他人是如何做到这一点的?
谢谢,Joe
更新: 显然,以下方法有效。
>Register-PackageSource -Trusted -ProviderName 'PowerShellGet' -Name 'Posh Test Gallery' -Location https://www.poshtestgallery.com/api/v2/
Register-PackageSource: Package Source 'Posh Test Gallery' exists.
>Install-Module AzureAD.Standard.Preview
>Import-Module AzureAD.Standard.Preview
WARNING: /Users/joe/.local/share/powershell/Modules/AzureAD.Standard.Preview/0.1.599.7
WARNING: AzureAD.Standard.Preview
WARNING: /Users/joe/.local/share/powershell/Modules/AzureAD.Standard.Preview/0.1.599.7/net471
WARNING: Loading module in coreclr folder: 'netstandard2.0' ...
>Connect-AzureAD
WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code sx22443 to authenticate.
此处
推荐答案
不完美但部分支持
>Register-PackageSource -Trusted -ProviderName 'PowerShellGet' -Name 'Posh Test Gallery' -Location https://www.poshtestgallery.com/api/v2/
Register-PackageSource: Package Source 'Posh Test Gallery' exists.
>Install-Module AzureAD.Standard.Preview
>Import-Module AzureAD.Standard.Preview
WARNING: /Users/joe/.local/share/powershell/Modules/AzureAD.Standard.Preview/0.1.599.7
WARNING: AzureAD.Standard.Preview
WARNING: /Users/joe/.local/share/powershell/Modules/AzureAD.Standard.Preview/0.1.599.7/net471
WARNING: Loading module in coreclr folder: 'netstandard2.0' ...
>Connect-AzureAD
WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code sx22443 to authenticate.
这篇关于如何在Mac上使用POWESHELL的azures模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文