Cannot get path of running script in $MyInvocation.InvocationName
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/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
- Lĩnh vực
- devtools
Hướng nghiên cứu
Tái hiện sự cố trong tiện ích mở rộng PowerShell với PowerShell 7.2.3 và VS Code 1.67.0, chạy $MyInvocation.InvocationName và kiểm tra $PSScriptRoot. So sánh hành vi với phiên bản tiện ích mở rộng 2021.12.0 và các phiên bản 2022.5.0/2022.5.1; hoàn tất khi đường dẫn tập lệnh được khôi phục mà không gây hồi quy cho phiên bản đang hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been reported.
- I have read the troubleshooting guide.
- I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
- I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
- If this is a security issue, I have read the security issue reporting guidance.
Summary
In versions 2022.5.0 and 2022.5.1
To get the path of a running script.
i tried
$MyInvocation.InvocationName
but I could not get the path by this command.
Similarly, to retrieve the path of a script running on
$PSScriptRoot
This also did not retrieve the path.
I downgraded the version to 2021.12.0 and got the path correctly
Thank you
Translated with www.DeepL.com/Translator
PowerShell Version
Name Value
---- -----
PSVersion 7.2.3
PSEdition Core
GitCommitId 7.2.3
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visual Studio Code Version
1.67.0
57fd6d0195bb9b9d1b49f6da5db789060795de47
x64
Extension Version
don't work
2022.5.0 and 2022.5.1
work
ms-vscode.powershell@2021.12.0
Steps to Reproduce
$MyInvocation.InvocationName
Visuals
No response
Logs
No response
- 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PowerShell/vscode-powershell
-
[aw] Agentic Issue Triage failed Đang mởagentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
PowerShell/vscode-powershell#5599 · 3 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PowerShell/vscode-powershell#5592 · 2 bình luận · 1 reaction ·
-
[aw] Agentic Issue Triage failed Đang mởagentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
PowerShell/vscode-powershell#5583 · 1 bình luận ·
-
powershell.scriptAnalysis.settingsPath (Description): Warning Message Should Provide A Workaround Đang mởArea-Code Formatting Issue-Enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
PowerShell/vscode-powershell#4653 · 3 bình luận · 4 reaction ·
-
nothing Đang mởIssue-Bug Needs: Triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 5/100
PowerShell/vscode-powershell#5603 · 1 reaction ·
Tất cả issue của PowerShell/vscode-powershell
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
area:tools bug good first issue help wanted priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
newrelic-experimental/preflight#793 · 1 bình luận ·
-
bug 🐞
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
BasedHardware/omi#15320 ·