Created
February 26, 2013 20:37
-
-
Save gravejester/5041943 to your computer and use it in GitHub Desktop.
Ever wanted to download a file from the web using PowerShell? It’s quite easy actually.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell wget | |
# Version 1.0 | |
[CmdletBinding()] | |
param( | |
[Parameter(ValueFromPipeline = $true, Mandatory = $true)] | |
$url, | |
$dest = (Get-Location).Path | |
) | |
if(!$url){break} | |
$filesplit = $url.split("\/") | |
$file = $filesplit[($filesplit.length-1)] | |
$fulldest = $dest + "\" + $file | |
(New-Object System.Net.WebClient).DownloadFile($url,$fulldest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment