![](/img/trans.png)
[英]Powershell / Visual Studio Code: Update version of Powershell in Visual Studio Code
[英]Powershell AzureAD module in Visual Studio Code
我正在尝试在 Visual Studio Code 中调试 powershell 脚本,但是当我尝试执行 connect-azuread 时,我收到以下错误消息:
connect-azuread:在模块“AzureAD”中找到了“connect-azuread”命令,但无法加载该模块。 有关详细信息,请运行“导入模块 AzureAD”。
当我尝试执行 Import-Module AzureAD 时,出现另一个错误:
导入模块:当前的处理器架构是:X86。 模块“C:\\Program Files\\WindowsPowerShell\\Modules\\azuread\\2.0.2.4\\azuread.psd1”需要以下体系结构:Amd64。
如果我将终端从 PowerShell Integrated 切换到 powershell 它可以工作,但是当我开始调试我的代码时,它会返回到集成的。
任何想法如何解决这一问题?
与此同时,我似乎设法通过将设置更新为以下内容来解决此问题:
{
"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"
}
从 VS 设置中的 powershell.powerShellDefaultVersion 设置中删除 (x86)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.