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

Lightbox Javascript Contents

These JavaScript codes are open source and part of many applications, such as NextGen Gallery.…

PowerShell: Try Catch Technique to Obtain Error Type

# Test try{Read-SCVirtualMachine $vmName -EA Stop}catch{$errorMessage=$error[0].Exception.GetType().FullNamewrite-host $errorMessage} # Get error type Microsoft.VirtualManager.Utils.CarmineException # Retry catch…

List Folder Sizes

# Powershell Script to list folders sizes Install-Module PSFolderSize $folders = "\\FILESERVER01\SHARE01","C:\Windows\Users\kimconnect" foreach ($folder in…