You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue
When using -ScriptUpdateOnly on a server that doesn't have internet access, we get the following output.
Expected behavior
We should provide a clearer error message and provide that the reason why we didn't update the script was because of an exception to get to the internet and that customer's shouldn't provide the information to us.
Script Output
Starting Logger Instance 11/25/2024 07:14:50
Calling Invoke-WebRequestWithProxyDetection
Calling Confirm-ProxyServer
No proxy server configuration detected
Invoke-WebRequest : The remote name could not be resolved: 'aka.ms'
Inner Exception: at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
Position Message: At C:\Users\Han\Desktop\HealthChecker.ps1:17079 char:9
+ Invoke-WebRequest @params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
Script Stack: at Invoke-WebRequestWithProxyDetection, C:\Users\Han\Desktop\HealthChecker.ps1: line 17079
at Get-ScriptUpdateAvailable, C:\Users\Han\Desktop\HealthChecker.ps1: line 17115
at Test-ScriptVersion, C:\Users\Han\Desktop\HealthChecker.ps1: line 17271
at <ScriptBlock><End>, C:\Users\Han\Desktop\HealthChecker.ps1: line 17366
at <ScriptBlock>, <No file>: line 1
Unable to check for updates: System.Management.Automation.MethodInvocationException: Exception calling "GetString" with "1" argument(s): "Array cannot be null.
Parameter name: bytes" ---> System.ArgumentNullException: Array cannot be null.
Parameter name: bytes
at System.Text.Encoding.GetString(Byte[] bytes)
at CallSite.Target(Closure , CallSite , Encoding , Object )
--- End of inner exception stack trace ---
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)
No update of the script performed.
There appears to have been some errors in the script. To assist with debugging of the script, please send the HealthChecker-Debug_*.txt, HealthChecker-Errors.json, and .xml file to [email protected].
Errors that occurred that wasn't handled
Error Index: 0
: Exception calling "GetString" with "1" argument(s): "Array cannot be null.
Parameter name: bytes"
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)
Position Message: At C:\Users\Han\Desktop\HealthChecker.ps1:17115 char:13
+ $versionData = [Text.Encoding]::UTF8.GetString((Invoke-We ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Script Stack: at Get-ScriptUpdateAvailable, C:\Users\Han\Desktop\HealthChecker.ps1: line 17115
at Test-ScriptVersion, C:\Users\Han\Desktop\HealthChecker.ps1: line 17271
at <ScriptBlock><End>, C:\Users\Han\Desktop\HealthChecker.ps1: line 17366
at <ScriptBlock>, <No file>: line 1
-----------------------------------
Repro Steps
Change this line to $false so the else statement always occurs.
Describe the issue
When using
-ScriptUpdateOnly
on a server that doesn't have internet access, we get the following output.Expected behavior
We should provide a clearer error message and provide that the reason why we didn't update the script was because of an exception to get to the internet and that customer's shouldn't provide the information to us.
Script Output
Repro Steps
$false
so theelse
statement always occurs.CSS-Exchange/Shared/ScriptUpdateFunctions/Get-ScriptUpdateAvailable.ps1
Line 32 in af0691c
-ScriptUpdateOnly
from a computer with no internet access.This doesn't report an issue with the normal run, because we loop through and catch all the errors the other way within
Invoke-HealthCheckerMainReport
The text was updated successfully, but these errors were encountered: