Currently, I have my logfile names set to be named as “$envComputerName $deploymentType $exitCode” and the toolkit does this, but I would like to have it rename the logfile just prior to exit so it shows the final exit code…or really just anything that’s not a defer, quick retry, success. All of the logs just show 0 at the end of the name, even after the install.
So I have a couple lines I added in the final Catch section of Deploy-Application.ps1 that rename the logfile to “$envComputerName $deploymentType $lastExitCode”. When I set some test variables (i.e. fake exit code) and run this on its own outside of the script it does rename the logfile as requested, but does not work inside the script. I believe it has something to do with the variable being cleared and maybe the placement of the lines would help this, but not quite sure. Any ideas or assistance is greatly appreciated.