Skip to content

Use basic parsing for IWR.#301

Merged
anshuldube merged 1 commit into
microsoft:mainfrom
Varbin:use-basic-parsing
Mar 11, 2021
Merged

Use basic parsing for IWR.#301
anshuldube merged 1 commit into
microsoft:mainfrom
Varbin:use-basic-parsing

Conversation

@Varbin
Copy link
Copy Markdown

@Varbin Varbin commented Mar 11, 2021

Issue:
Download of Baselines fails if the Internet Explorer is not configured.

Reason:
Powershell uses parts of the Internet Explorer to parse responses of Invoke-WebRequest. For new accounts the Internet Explorer is possibly not configured.

Fix:
Add -UseBasicParsing to Invoke-WebRequest calls. As the downloaded files are either plain text or Zip archives, no parsing whatsoever is required anyway.

Validation:
Before:

[03/11/2021 18:11:21] Started...
Found exchange version: 15.0.1497.2
Can't find local baseline for 15.0.995.28
Downloading baseline file from GitHub to C:\Users\exchadmin\Desktop\CSS-Exchange
-21.03.11.1408\Security\src\Baselines\baseline_15.0.995.28.zip
LoadFromGitHub : Cannot reach out to
https://github.com/microsoft/CSS-Exchange/releases/latest, please download
baseline files for 15.0.995.28 15.0.516.30 15.0.1104.5 15.0.1473.5 15.0.1497.0
15.0.1497.2 15.0.1473.3 15.0.1497.12 15.0.620.29 15.0.1497.6 15.0.1395.4
15.0.995.32 15.0.712.23 15.0.1263.5 from
https://github.com/microsoft/CSS-Exchange/releases/latest manually to
C:\Users\exchadmin\Desktop\CSS-Exchange-21.03.11.1408\Security\src\Baselines,
then rerun this script from
C:\Users\exchadmin\Desktop\CSS-Exchange-21.03.11.1408\Security\src\Baselines.
In C:\Users\exchadmin\Desktop\CSS-Exchange-21.03.11.1408\Security\src\CompareEx
changeHashes.ps1:629 Zeichen:13
+             LoadFromGitHub -url $zip_file_url -filename $zip_file -in ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep
   tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
   n,LoadFromGitHub

After adding flag (there is still an error, because the zip file does not exist on Github; the connection test by downloading a text file succeeds):

PS C:\Users\exchadmin\Desktop\CSS-Exchange-21.03.11.1408\Security\src> .\Compare
ExchangeHashes.ps1
[03/11/2021 18:28:22] Started...
Found exchange version: 15.0.1497.2
Can't find local baseline for 15.0.995.28
Downloading baseline file from GitHub to C:\Users\exchadmin\Desktop\CSS-Exchange
-21.03.11.1408\Security\src\baseline_15.0.995.28.zip
LoadFromGitHub : C:\Users\exchadmin\Desktop\CSS-Exchange-21.03.11.1408\Security
\src\baseline_15.0.995.28.zip not found... please open issue on
https://github.com/microsoft/CSS-Exchange/issues, we will work on it
In C:\Users\exchadmin\Desktop\CSS-Exchange-21.03.11.1408\Security\src\CompareEx
changeHashes.ps1:629 Zeichen:13
+             LoadFromGitHub -url $zip_file_url -filename $zip_file -in ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep
   tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
   n,LoadFromGitHub

@bill-long bill-long requested a review from anshuldube March 11, 2021 18:27
@anshuldube anshuldube merged commit be84b99 into microsoft:main Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants