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

Set Permissions of NTFS/SMB Directories Recursively

# Set variables here$proxy="http://proxy:80"$directories="\\FILESERVER01\dept01$","\\FILESERVER01\dept02$"$grantAccess="KIMCONNECT\SysAdmins"$access="Full"# Run as$username = "kimconnect\kim"$password = "PASSWORD"#$username = "kimconnect\"+(Read-Host -Prompt 'Input the…

Hyper-V Set CompatibilityForMigrationEnabled

$vmName='TESTVM' function enableCpuCompatibility($vmName){ $compatibilityForMigration=(Get-VMProcessor $vmName).CompatibilityForMigrationEnabled if(!$compatibilityForMigration){ $vmIsRunning=(get-vm $vmname).State -eq 'Running' if($vmIsRunning){stop-vm $vmName} Set-VMProcessor$vmName -CompatibilityForMigrationEnabled 1…

How To Automate Youtube Full Screen on Ubuntu Using Python & Selenium

#sudo apt install python3 python3-pip #sudo pip3 install selenium #pip install webdriver-manager # Variables YoutubeUrl="https://www.youtube.com/watch?v=7nT5YawZt-s"…