`Trace-Command -Name TypeConversion` might not unwind the tracing scope stack after a failed cast
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
- 67/100
Hướng nghiên cứu
Start by running the four Trace-Command -Name TypeConversion examples from the issue and compare indentation before and after the failed cast. Read the Trace-Command TypeConversion tracing and scope-stack handling, then verify that a failed conversion unwinds its scope so the final successful conversion has normal indentation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Trace-Command -Name TypeConversion -PSHost -Expression { [int]'123' };
Trace-Command -Name TypeConversion -PSHost -Expression { [int]'123' };
Trace-Command -Name TypeConversion -PSHost -Expression { [int]'Hello' };
Trace-Command -Name TypeConversion -PSHost -Expression { [int]'Hello' };
Expected behavior
DEBUG: 2026-09-19 19:37:39.6858 TypeConversion Information: 0 : Converting to integer.
123
DEBUG: 2026-09-19 19:37:39.6900 TypeConversion Information: 0 : Converting to integer.
123
DEBUG: 2026-09-19 19:37:39.6912 TypeConversion Information: 0 : Converting to integer.
DEBUG: 2026-09-19 19:37:39.6918 TypeConversion Information: 0 : Exception converting to integer: "The input string 'Hello' was not in a correct format.".
<...>
InvalidArgument:
Line |
4 | … ce-Command -Name TypeConversion -PSHost -Expression { [int]'Hello' };
| ~~~~~~~~~~~~
| Cannot convert value "Hello" to type "System.Int32". Error: "The input string 'Hello' was not in a correct format."
DEBUG: 2026-09-19 19:37:39.7870 TypeConversion Information: 0 : Converting to integer.
<...>
Actual behavior
The last tracing output starts with high indentation.
<...>
DEBUG: 2026-09-19 19:37:39.7870 TypeConversion Information: 0 : Converting to integer.
<...>
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.6.6
PSEdition Core
GitCommitId 7.6.6
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
Note how after the error, the messages are highly indented.
- Ngôn ngữ chính
- C#
- Star
- 55.5k
- Fork
- 8.5k
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 97
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/PowerShell
-
Issue-Enhancement Needs-Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
PowerShell/PowerShell#28061 · 2 reaction ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
PowerShell/PowerShell#28037 ·
-
Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
PowerShell/PowerShell#27973 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PowerShell/PowerShell#27720 ·
-
Issue-Bug Up-for-Grabs WG-Cmdlets WG-Reviewed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PowerShell/PowerShell#27670 · 3 bình luận ·
Tất cả issue của PowerShell/PowerShell
Issue tương tự
-
Status: Waiting triage Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
nanoframework/Home#1857 ·
-
kind/bug kind/regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unoplatform/uno.toolkit.ui#1646 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nightscout/nocturne#1379 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
elastic/esql-dotnet#47 ·
-
port: add go-steam fork Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100