microsoft / microsoft/CSS-Exchange

[Issue] SetupLogReviewer doesn't handle logs gracefully

Open
#2,501 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue Setup Setup Log Reviewer
Dominant language
PowerShell
Stars
1.3k
Forks
395
Avg merge
14h 7m
Merged PRs (30d)
5

Description

Describe the issue
Getting a failure to run the script because we can't properly determine the last install attempt section. Then fail out the entire script.

Expected behavior
Try to handle these unexpected behaviors better.

Script Output

.\SetupLogReviewer.ps1 "C:\DesktopNonOneDrive\Temp\ExchangeSetup (1)\ExchangeSetup.log"
Setup Log Reviewer Version:
Setup Mode: Upgrade
Setup.exe Run Date: 02/09/2026 08:33:49
Setup.exe Build Number: 15.2.2562.17


----------------Error Information----------------
Test-PrerequisiteCheck : Cannot index into a null array.
Inner Exception:    at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.PSScriptCmdlet.DoProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
Position Message: At C:\GitHub\CSS-Exchange\Setup\Shared\SetupLogReviewerLogic.ps1:33 char:43
+             $result = $SetupLogReviewer | & $test
+                                           ~~~~~~~
Script Stack: at Test-PrerequisiteCheck<Process>, C:\GitHub\CSS-Exchange\Setup\SetupLogReviewer\Checks\FindContext\Test-PrerequisiteCheck.ps1: line 103
at InvokeTests, C:\GitHub\CSS-Exchange\Setup\Shared\SetupLogReviewerLogic.ps1: line 33
at Invoke-SetupLogReviewer, C:\GitHub\CSS-Exchange\Setup\Shared\SetupLogReviewerLogic.ps1: line 88
at <ScriptBlock>, C:\GitHub\CSS-Exchange\Setup\SetupLogReviewer\SetupLogReviewer.ps1: line 26
at <ScriptBlock>, <No file>: line 1
-------------------------------------------------


WARNING: Ran into an issue with the script. If possible please email the Setup Log to 'ExToolsFeedback@microsoft.com', or at least notify them of the issue.

Additional context
This appears to be similar to a previous issue #716. Need to make sure that we add in a pester test for this and understand why this issue came back.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Setup/SetupLogReviewer/Checks/FindContext/Test-PrerequisiteCheck.ps1 at line 103 and Setup/Shared/SetupLogReviewerLogic.ps1 at line 33, then compare the behavior with previous issue #716. Reproduce the failure using the reported log scenario and add a Pester test for an unrecognized last install attempt section. Done means the reviewer handles that unexpected log behavior without failing the entire script.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
testing-qa, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.