You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new-in-7.4 ErrorRecord.InvocationInfo.Statement property is designed to report the whole statement that triggered the error (possibly spanning multiple lines).
This doesn't work when the error was triggered by a command syntax error or by a parameter having been passed an invalid argument (in other words: the problem seems related to the parameter binder reporting the error):
That is, only the offending parameter is reported.
This applies both to unrecognized parameters and known parameters having been given no argument.
If a known parameter is given an invalid argument, only that argument is reported.
Prerequisites
Steps to reproduce
The new-in-7.4
ErrorRecord.InvocationInfo.Statementproperty is designed to report the whole statement that triggered the error (possibly spanning multiple lines).This doesn't work when the error was triggered by a command syntax error or by a parameter having been passed an invalid argument (in other words: the problem seems related to the parameter binder reporting the error):
Expected behavior
[Get-Item -NoSuchParameter -LiteralPath .]Actual behavior
[-NoSuchParameter]That is, only the offending parameter is reported.
This applies both to unrecognized parameters and known parameters having been given no argument.
If a known parameter is given an invalid argument, only that argument is reported.
Error details
No response
Environment data
Visuals
No response