Prerequisites
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.

Prerequisites
Steps to reproduce
Expected behavior
Actual behavior
The last tracing output starts with high indentation.
Error details
No response
Environment data
Visuals
Note how after the error, the messages are highly indented.