Invoke-Expression ignores the common -ErrorAction parameter #19734
Labels
Needs-Triage
The issue is new and needs to be triaged by a work group.
WG-Cmdlets-Utility
cmdlets in the Microsoft.PowerShell.Utility module
Prerequisites
Steps to reproduce
Invoke-Expression
unexpectedly ignores the common-ErrorAction
parameter when applied to itself (as opposed to the string being evaluated happening to contain a command with-ErrorAction
).The suboptimal workaround is to use
2>$null
, though that is the equivalent of-ErrorAction SilentlyContinue
, notIgnore
.Also note:
-ErrorVariable
does work.Expected behavior
No output (the non-terminating error should be ignored).
Actual behavior
The non-terminating error prints.
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: