Skip to content

Instantly share code, notes, and snippets.

@igorpopovio
Created July 16, 2014 13:56
Show Gist options
  • Save igorpopovio/40ff7e5b8ede71cf71d5 to your computer and use it in GitHub Desktop.
Save igorpopovio/40ff7e5b8ede71cf71d5 to your computer and use it in GitHub Desktop.
Download a file in PowerShell using the wget style - guess filename, don't hard-code anything!
function DownloadFileFrom($link) {
$filename = [System.IO.Path]::GetFileName($link)
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($link, $filename)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment