Delete specific rows from ErrorRecord #2319
-
Is there any way to delete specific lines from ErrorRecord please? I only want the first line, then the lines starting with 'Expected:' (line 5) and 'But Was:' (line 6), so I'd like to delete the lines starting ErrorRecord: Expected length: * , Actual length: *, and Strings differ at index 0. Expected strings to be the same, because TREE be set to TRUE, but they were different. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Could you explain the use case? Where would you use this and how? Are you trying to modify it before Pester prints to screen? Or are you using |
Beta Was this translation helpful? Give feedback.
$_.ErrorRecord.DisplayErrorMessage -replace '(?ms)^Expected length:.*?(Expected:.*?)\s+\^', '$1'