Visual Studio代码中的Powershell AzureAD模块

Visual Studio代码中的Powershell AzureAD模块,powershell,visual-studio-code,Powershell,Visual Studio Code,我试图在Visual Studio代码中调试powershell脚本,但当我尝试执行connect azuread时,我收到以下错误消息: connect-azuread:在模块'azuread'中找到'connect-azuread'命令,但无法加载该模块。有关详细信息,请运行“导入模块AzureAD” 当我尝试导入模块AzureAD时,我遇到另一个错误: 导入模块:当前处理器体系结构为:X86。模块“C:\Program Files\WindowsPowerShell\Modules\azu

我试图在Visual Studio代码中调试powershell脚本,但当我尝试执行connect azuread时,我收到以下错误消息:

connect-azuread:在模块'azuread'中找到'connect-azuread'命令,但无法加载该模块。有关详细信息,请运行“导入模块AzureAD”

当我尝试导入模块AzureAD时,我遇到另一个错误:

导入模块:当前处理器体系结构为:X86。模块“C:\Program Files\WindowsPowerShell\Modules\azuread\2.0.2.4\azuread.psd1”需要以下体系结构:Amd64

如果我将终端从PowerShell Integrated切换到PowerShell,它会工作,但当我开始调试代码时,它会返回到Integrated


有没有办法解决这个问题?

与此同时,我似乎通过将设置更新为以下内容来解决这个问题:

{
"powershell.powerShellExePath": 
    "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "terminal.integrated.shell.windows": 
    "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "terminal.explorerKind": "external"
}
原始版本如下,看起来SysWow64版本是32位的

{
    "powershell.powerShellExePath": "C:\\WINDOWS\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe",
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
}

同时,我似乎通过将设置更新为以下内容来解决此问题:

{
"powershell.powerShellExePath": 
    "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "terminal.integrated.shell.windows": 
    "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "terminal.explorerKind": "external"
}
原始版本如下,看起来SysWow64版本是32位的

{
    "powershell.powerShellExePath": "C:\\WINDOWS\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe",
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
}

是否确实安装了64位版本的Visual Studio代码?我无法复制这个问题,尽管我承认我使用的是AzureAD v2.0.2.26,这是默认情况下从
Find Module-Name AzureAD | Install Module
安装的。是的,我甚至卸载并重新安装了代码您确定安装了64位版本的Visual Studio代码吗?我无法复制这个问题,尽管我承认使用了AzureAD v2.0.2.26,这是默认情况下从
Find Module-Name AzureAD | Install Module
安装的。是的,我甚至卸载并重新安装了代码