Created
October 7, 2013 14:41
-
-
Save serdarb/6869134 to your computer and use it in GitHub Desktop.
Download and Unzip Powershell
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
$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