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 Trusted
Install the module from the NuGet package manager:
Install-Module Console-Download -Repository NuGet -Scope CurrentUser
You 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 3
Download 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 $urls
Pass a list of URLs from a file:
$urls = Get-Content "$home\Desktop\links.txt"
Invoke-Download $urls
Example result:
Thread : 2
Time : 00:00:23
Minimum : 0,00 MByte/sec
Average : 8,89 MByte/sec
Maximum : 51,00 MByte/sec
The module contains the function of getting an up-to-date list of Looking Class hosts endpoints from Looking.House.
$urls = Get-LookingGlassList
You 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.mb
Select 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.mb
Start 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/sec
Use 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