PowerShell 7 has made some improvements in the way error handling and made it more useful. This includes changes in the default error view, new error action preference and introduction of new cmdlet, Get-Error
as well.
Changes in the Error View
A new view called $ConciseView
has been created to improve the readability of the errors. This generates a single line error. Before PowerShell 7, the default view used to be $NormalView
, which used to generate multi-line error and enhanced view. We can view the current default by using variable $errorview
: