簡體   English   中英

Visual Studio Code 中的 Powershell AzureAD 模塊

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM