Get-URL ... aka wget

Topics: Developer Forum, User Forum
May 3, 2007 at 12:01 PM
I don't use wget very often (or for anything very complicated) so this script is enough for me.

Would anyone like to take a shot at turning it into a little more full-featured version of wget?

param([string]$url, [string]$path)
if(!(Split-Path -parent $path) -or !(Test-Path -pathType Container (Split-Path -parent $path))) {
  $path = Join-Path $pwd (Split-Path -leaf $path)
"Downloading [$url]`nSaving at [$path]"
$client = new-object System.Net.WebClient
$client.DownloadFile( $url, $path )
Jun 19, 2007 at 12:28 AM
I have a pet project I'm working on for dealing with async (and synchronous) .net events in powershell over at - check out the sql-server backup script with progress reporting done with async events, on the releases page.