PSModulePath mutated during script changes

未关闭
#2,008 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
powershell, typescript, vscode

调研方向

首先在 PowerShell Integrated Console (PSIC) 中重现该问题:记录 PSModulePath,编辑一个脚本,然后再次进行比较。接着跟踪 runspace 的创建和初始化,因为 issue 指出启动 runspace 可能会更新 PSModulePath。当编辑脚本不再意外修改现有的 PSModulePath 时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Area-Engine Issue-Performance

Issue Description

PSModulePath is modified with every edit to a file.

Steps to repo

Run this in the PSIC:

$env:PSModulePath
$env:PSModulePath = "C:\Users\tyleonha\.vscode-insiders\extensions\ms-vscode.powershell-preview-2019.5.0\modules"
$env:PSModulePath

Verify it changed.

Now make a single edit to a script and check the PSModulePath once more... It should look like:

C:\Users\tyleonha\Documents\PowerShell\Modules;C:\Users\tyleonha.vscode-insiders\extensions\ms-vscode.powershell-preview-2019.5.0\modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7-preview\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules

Apparently, the PSModulePath is updated every time you spin up a Runspace so I wonder if we're doing something like that...

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.18362
VSCode 1.35.0-insider
PowerShell Extension Version 2019.5.0

PowerShell Information

Name Value
PSVersion 7.0.0-preview.1
PSEdition Core
GitCommitId 7.0.0-preview.1
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 7.0.0-preview.1
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
azure-account ms-vscode 0.8.4
csharp ms-vscode 1.19.1
horizon-theme-vscode jolaleye 1.8.1
powershell-preview ms-vscode 2019.5.0
remote-containers ms-vscode-remote 0.57.0
remote-ssh ms-vscode-remote 0.41.0
remote-ssh-edit ms-vscode-remote 0.41.0
remote-ssh-explorer ms-vscode-remote 0.41.0
remote-wsl ms-vscode-remote 0.36.0
vscode-azurefunctions ms-azuretools 0.17.1
vscode-remote-extensionpack ms-vscode-remote 0.14.0
主要语言
TypeScript
星标
1.9k
派生
548
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/vscode-powershell 的其他 Issue

查看 PowerShell/vscode-powershell 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。