Wget-DL.ps1
function Wget-DL { param( [Parameter(Mandatory)] [String]$url, [ValidateScript({ if(-Not ($_ | Test-Path -PathType Container) ){ throw "The Path argument must be a folder." } return $true })] [System.IO.FileInfo]$OutDir = $PWD.Path ) $OutPath = Join-Path -Path $OutDir -ChildPath $(Split-Path -Leaf -Path $url) Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $OutPath } |