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: Get Event Logs from a List of Computers

Windows event logs contain a wealth of information that would be useful for analytical purposes.…

Automating Scheduled Task Creation on Remote Computers

# createTaskScheduler.ps1 # What this script does: # 1. Ask user for valid Domain Admin…

PowerShell: Test LDAPS Connection

Function testLdap { [CmdletBinding()] Param( [Parameter(Position=0,ValueFromPipeline=$true)]$dcs=$($ENV:LOGONSERVER -replace '\\',''), [Parameter(Position=1,ValueFromPipeline=$true)]$port='636' ) $ErrorActionPreference = "Stop" $results =…