Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 2fcb1a4

Browse files
committed
Initial PowerShell script which downloads and extracts Precompiled.zip
1 parent 9d54c56 commit 2fcb1a4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

install-from-url.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
$cd = (split-path $MyInvocation.MyCommand.Path -parent)
2+
3+
if ($args.length -eq 0)
4+
{
5+
Write-Error "No URL Provided."
6+
}
7+
else
8+
{
9+
$zipOrigin = $args[0]
10+
$zipPath = $cd + "\Precompiled.zip"
11+
12+
Write-Host " * Downloading $zipOrigin to $zipPath..." -foregroundcolor "green"
13+
(New-Object System.Net.WebClient).DownloadFile($zipOrigin, $zipPath)
14+
15+
Write-Host " * Extracting files into $cd..." -foregroundcolor "green"
16+
$shell = New-Object -com Shell.Application
17+
$zipFile = $shell.NameSpace($zipPath)
18+
foreach($item in $zipFile.items())
19+
{
20+
$shell.Namespace($cd).copyhere($item)
21+
}
22+
23+
Write-Host " * Removing Precompiled.zip..." -foregroundcolor "green"
24+
Remove-Item $zipPath
25+
26+
Write-Host " * Finished!" -foregroundcolor "green"
27+
}

0 commit comments

Comments
 (0)