Skip to content

Instantly share code, notes, and snippets.

@serdarb
Created October 7, 2013 14:41
Show Gist options
  • Save serdarb/6869134 to your computer and use it in GitHub Desktop.
Save serdarb/6869134 to your computer and use it in GitHub Desktop.
Download and Unzip Powershell
$path = "C:\Setups"
$url = "http://www.dotpdn.com/files/Paint.NET.3.5.11.Install.zip"
md $path
$pieces = $url.Split("/")
$fileName = $pieces[$pieces.Count-1]
$unzipped = "$path\$fileName"
$webClient = New-Object System.Net.WebClient
$webClient.DownloadFile($url,$unzipped)
$shellApp = New-Object -com shell.application
$destination = $shellApp.namespace($path)
$destination.Copyhere($shellApp.namespace($unzipped).items())
Copy-Item "$unzipped.replace(".zip","")\*" $path -recurse
Remove-Item $unzipped -recurse -force
Remove-Item $fileName -recurse -force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment