Azure AD - OSX 上的 Powershell

Posted

技术标签:

【中文标题】Azure AD - OSX 上的 Powershell【英文标题】:Azure AD - Powershell on OSX 【发布时间】:2022-01-22 10:52:33 【问题描述】:

我已成功(据我所知)在我的系统上安装了 AzureADPreview。但是,当我尝试执行一个简单的命令时,它表明 AzureADPreview 没有安装。还有其他人遇到这个吗?

PS /Users/djacobus> Install-Module -Name AzureADPreview -Force -Verbose
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AzureADPreview'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'AzureADPreview'.
VERBOSE: Performing the operation "Install-Module" on target "Version '2.0.2.138' of module 'AzureADPreview'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in '/Users/djacobus/.local/share/powershell/Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'AzureADPreview' with version '2.0.2.138' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AzureADPreview'' for ''.
VERBOSE: InstallPackage' - name='AzureADPreview', version='2.0.2.138',destination='/tmp/342766576'
VERBOSE: DownloadPackage' - name='AzureADPreview', version='2.0.2.138',destination='/tmp/342766576/AzureADPreview.2.0.2.138/AzureADPreview.2.0.2.138.nupkg', uri='https://www.powershellgallery.com/api/v2/package/AzureADPreview/2.0.2.138'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/AzureADPreview/2.0.2.138'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/AzureADPreview/2.0.2.138'.
VERBOSE: Completed downloading 'AzureADPreview'.
VERBOSE: InstallPackageLocal' - name='AzureADPreview', version='2.0.2.138',destination='/tmp/342766576'
VERBOSE: Validating the 'AzureADPreview' module contents under '/tmp/342766576/AzureADPreview.2.0.2.138' path.
VERBOSE: Test-ModuleManifest successfully validated the module manifest file '/tmp/342766576/AzureADPreview.2.0.2.138'.
VERBOSE: Module 'AzureADPreview' was installed successfully to path '/Users/djacobus/.local/share/powershell/Modules/AzureADPreview/2.0.2.138'.
PS /Users/djacobus> Enable-DCAzureADPIMRole
Enable-DCAzureADPIMRole: The Azure AD Preview PowerShell module is not installed. Please, run 'Install-Module AzureADPreview -Force' as an admin and try again.

我已经尝试了明显的卸载、重新安装、管理员访问等。

【问题讨论】:

【参考方案1】:

我相信我发现了这个问题……遗憾的是,这似乎是一个架构问题。我正在运行新的 M1 Macbook。

Import-Module AzureADPreview Import-Module: The current processor architecture is: MSIL. The module '.../AzureADPreview.psd1' requires the following architecture: Amd64

【讨论】:

以上是关于Azure AD - OSX 上的 Powershell的主要内容,如果未能解决你的问题,请参考以下文章

ASP.NET Core Azure AD OpenID - 生产服务器上的令牌签名验证失败

如何使用 /common 端点上的 user_impersonation 范围生成的令牌获取所有 Azure AD 帐户列表

Azure *** P2S Azure AD认证连接问题:操作被用户取消

Azure 实践系列 3:Azure AD中的服务器管理

Azure AD B2C初识

Windows 10 上带有 Azure AD 示例的 Flask 应用程序