PSModulePath mutated during script changes

Đang mở
#2,008 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
powershell, typescript, vscode

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề trong PowerShell Integrated Console (PSIC): ghi lại PSModulePath, chỉnh sửa một script, rồi so sánh lại. Sau đó, truy vết việc tạo và khởi tạo runspace, vì issue ghi nhận rằng việc khởi động một runspace có thể cập nhật PSModulePath. Được xem là hoàn tất khi việc chỉnh sửa một script không còn vô tình thay đổi PSModulePath hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
1.9k
Fork
548
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/vscode-powershell

Tất cả issue của PowerShell/vscode-powershell

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.