-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
Update: The issue is not one of missing InnerException information, but one of situationally different ordering.
Steps to reproduce
# OK: The "InnerException :" line is followed by a "Message: " line for the inner exception.
try { 1/0 } catch {}; (Get-Error | Out-String -Stream) -replace '\e[^m]*m' | Select-String -context 0,1 '\bInnerException\b' | % { $_.Context.PostContext } | Should -Match 'Attempted to divide by zero'
# FAILS: The "InnerException :" line is followed by no fields describing the inner exception.
try { [int]::parse('foo') } catch {}; (Get-Error | Out-String -Stream) -replace '\e[^m]*m' | Select-String -context 0,1 '\bInnerException\b' | % { $_.Context.PostContext } | Should -Match 'not in a correct format'Expected behavior
Both tests should succeed.
Actual behavior
The 2nd test fails:
Expected regular expression 'not in a correct format' to match ' TargetSite : ', but it did not match.
That is, the InnerException: line wasn't followed by the Message: line.
Environment data
PowerShell Core 7.0.0-preview.5
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module