debugging VsCode挂起/冻结,状态栏中显示“Starting up powershell”

gab6jxml  于 2023-03-30  发布在  Vscode
关注(0)|答案(2)|浏览(204)

有时启动VsCode调试文件时,PowerShell扩展挂起,VsCode终端窗口显示状态栏消息Starting PowerShell。它从未超时,也从未崩溃,只是停留在Starting PowerShell
这个问题会有各种各样的答案..让我从两个解决方案开始,已经为我工作。

toiithl6

toiithl61#

确保所有其他PowerShell窗口都已关闭

  • 确认所有PowerShell进程在相关操作系统中终止,例如Windows中的任务管理器。*

以管理员身份启动VsCode。
如果系统提示您更新软件包管理器,请执行以下操作:
powershell.exe -NoLogo -NoProfile -Command 'Install-Module -Name PackageManagement -Force -MinimumVersion 1.4.6 -Scope CurrentUser -AllowClobber'
如果失败,在终端运行Powershell命令,例如
Get-PSRepository
这将完成“启动Powerhell”,并在状态栏中,您将看到Powershell版本。

c86crjj0

c86crjj02#

我遇到了这个问题,并在VSCode工作的系统上比较$PSModulePath值,我发现工作系统的第一个和第二个条目是%ProgramFiles%\WindowsPowerShell\Modules和%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules。我更新了我的坏系统以匹配,神奇的是我的vscode powershell扩展可以正常工作。

相关问题