A command line tool for downloading files from a passed URL list in multithreaded mode and displays the download speed in real time.
This tool is suitable for testing the network interface throughput via Looking Glass hosts in order to debug monitoring system sensors or check Internet speed. Once all files have been downloaded, the maximum, average and minimum download speeds during operation are displayed.
You must have a NuGet repository registered:
Register-PSRepository -Name "NuGet" -SourceLocation "https://www.nuget.org/api/v2" -InstallationPolicy TrustedInstall the module from the NuGet package manager:
Install-Module Console-Download -Repository NuGet -Scope CurrentUserYou can import a module directly from GitHub into the current PowerShell session with a single command:
Invoke-Expression $(Invoke-RestMethod "https://raw.githubusercontent.com/Lifailon/Console-Download/rsa/module/Console-Download/Console-Download.psm1")Passing one URL to download one file to default directory (parameter Path: %USERPROFILE%\Downloads):
Invoke-Download -Url "https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.zip"Parallel downloading in multi-threaded mode of one file (from one URL) a specified number of times (available from 1 to 20):
Invoke-Download -Url "https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.zip" -Thread 3Download multiple files at once:
$urls = @(
"https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.zip",
"https://github.com/Lifailon/helperd/releases/download/0.0.1/Helper-Desktop-Setup-0.0.1.exe"
)
Invoke-Download $urlsPass a list of URLs from a file:
$urls = Get-Content "$home\Desktop\links.txt"
Invoke-Download $urlsExample result:
Thread : 2
Time : 00:00:23
Minimum : 0,00 MByte/sec
Average : 8,89 MByte/sec
Maximum : 51,00 MByte/secThe module contains the function of getting an up-to-date list of Looking Class hosts endpoints from Looking.House.
$urls = Get-LookingGlassListYou can filter the resulting list by region:
$usaNy = $urls | Where-Object region -like *USA*New*York*Example host list for the US, New York region:
$usaNy | Format-List
region : USA, NY, New York
url10mb : https://191-96-196-147.lg.looking.house/10.mb
url100mb : https://191-96-196-147.lg.looking.house/100.mb
url1000mb : https://191-96-196-147.lg.looking.house/1000.mb
region : USA, NY, New-York
url10mb : https://5-188-0-17.lg.looking.house/10.mb
url100mb : https://5-188-0-17.lg.looking.house/100.mb
url1000mb : https://5-188-0-17.lg.looking.house/1000.mbSelect the desired URL by sequence number (index) and size (file size 100 mbyte):
$url = $usaNy[0].url100mb
Write-Host $url
https://191-96-196-147.lg.looking.house/100.mbStart testing the download:
Invoke-Download $url
Thread : 1
Time : 00:00:10
Minimum : 0,00 MByte/sec
Average : 9,90 MByte/sec
Maximum : 14,20 MByte/secUse multiple threads to download one file:
Invoke-Download $url -Thread 3
Thread : 3
Time : 00:00:28
Minimum : 0,00 MByte/sec
Average : 12,64 MByte/sec
Maximum : 30,10 MByte/sec