Giter VIP home page Giter VIP logo

lifailon / console-download Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 992 KB

A command line tool for downloading files from a passed URL list in multithreaded mode and displays the download speed in real time.

Home Page: https://nuget.org/packages/Console-Download

License: MIT License

PowerShell 100.00%
download download-file downloader interface-test internet-speed iperf powershell powershell-module speedtest speedtest-cli

console-download's Introduction

Console-Download

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.

Image alt

๐Ÿš€ Install

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")

โฌ Start

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

๐Ÿ“ถ Looking Glass Integration

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

console-download's People

Contributors

lifailon avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.