Posted On March 7, 2022

PowerShell: Downloading File Error ‘Internet Explorer engine is not available’

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: Downloading File Error ‘Internet Explorer engine is not available’

Error Message:

PS C:\temp> wget http://download.windowsupdate.com/d/msdownload/update/software/secu/2022/01/windows10.0-kb5009546-x64_d3ab97e9f811d7bf19c268e5e6b5e00e92e110ed.msu
wget : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet
Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.
At line:1 char:1
+ wget  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
    + FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Work-around

$url='http://download.windowsupdate.com/d/msdownload/update/software/secu/2022/01/windows10.0-kb5009546-x64_d3ab97e9f811d7bf19c268e5e6b5e00e92e110ed.msu'
Invoke-WebRequest -Uri $url -UseBasicParsing

Explanation:
The ‘ UseBasicParsing ‘ uses the response object for HTML content, bypassing Document Object Model (DOM) parsing. When Internet Explorer is not installed, such as on a Server Core installation of a Windows Server operating system, this parameter is required. (Source: Microsoft)

Error Message if File is Large

wget : Array dimensions exceeded supported range.
At line:1 char:1
+ wget  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], OutOfMemoryException
    + FullyQualifiedErrorId : System.OutOfMemoryException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Use BitsTransfer

$fileURL = "http://download.windowsupdate.com/d/msdownload/update/software/secu/2022/01/windows10.0-kb5009546-x64_d3ab97e9f811d7bf19c268e5e6b5e00e92e110ed.msu"
$output = "C:\Temp\jan-2022-rollup.msu"

Import-Module BitsTransfer
Start-BitsTransfer -Source $fileURL -Destination $output

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Auto Login to WordPress and Update Gold Prices WooCommerce Plugin

# API URI - these are examples, only $goldPriceApi='https://dragoncoin.com/XAU/USD' $silverPriceApi='https://dragoncoin.com/XAG/USD' $platinumApi='https://dragoncoin.com/XPT/USD' $palladiumApi='https://dragoncoin.com/XPD/USD' # Wordpress WooCommerce…

Basic HTML and HTML5: Link to Internal Sections of a Page with Anchor Elements

<h2>Demo</h2><main><a href="#footer">Jump to Bottom</a><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."><p>Kitty ipsum dolor…

PowerShell: Windows 10 Cleanup

Update: there's a new script to cleanup windows here. function cleanWindows{ write-host 'Disabling Windows Media…