PSAppDeployToolkit icon indicating copy to clipboard operation
PSAppDeployToolkit copied to clipboard

Behaviour of "Resolve-Error" was changed inadvertently

Open thomfroi opened this issue 3 years ago • 2 comments

Describe the bug Only toplevel error records get logged. "Inner" error records get lost.

To Reproduce Within a Deploy-Application.ps1 script file, enter an invalid command, e. g. Execute-Process -Path "DoesNotExist.exe" Run the script. I would expect the log to contain "The term 'DoesNotExist.exe' is not recognized as the name of a cmdlet ... ', like this was the case with older versions of the toolkit. (For example, in version 3.6.8 the logging appeared to be like this) Instead, in the current version of the toolkit, the log only contains a very general message like "Function failed ..."

Screenshots Version 3.8.4 image image

Version 3.6.8 image

Toolkit Version: 3.8.4

Powershell Version: 5.1.19041.906

Additional context See also "Logging of Error Records" in the forum

thomfroi avatar May 31 '21 13:05 thomfroi

I noticed the same problem and use Resolve-Error -Property ('Message','ScriptStackTrace','PositionMessage') as a workaround, omitting the 'InnerException'-property which is used by default

JanGruyaert avatar Sep 04 '21 20:09 JanGruyaert

I have tested and confirmed this is not reproducible in the next release, which reverts the changes made to this function in v3.8.4.

seanlillis avatar Mar 27 '22 22:03 seanlillis

Fixed in v3.9.0.

seanlillis avatar Jan 12 '23 21:01 seanlillis