aboutsummaryrefslogtreecommitdiff
path: root/PxShared/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1
diff options
context:
space:
mode:
authorMarijn Tamis <[email protected]>2019-04-01 14:21:09 +0200
committerMarijn Tamis <[email protected]>2019-04-01 14:21:09 +0200
commitd243404d4ba88bcf53f7310cc8980b4efe38c19f (patch)
treedcc8ce2904e9f813e03f71f825c4d3c9ec565d91 /PxShared/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1
parentAdd new SetSpheres and SetPlanes api's to bring them in line with setTriangles. (diff)
downloadarchived-nvcloth-1.1.6.tar.xz
archived-nvcloth-1.1.6.zip
1.1.6 Release.1.1.6
Diffstat (limited to 'PxShared/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1')
-rw-r--r--PxShared/buildtools/packman/win-bootstrap/fetch_file_from_url.ps137
1 files changed, 0 insertions, 37 deletions
diff --git a/PxShared/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1 b/PxShared/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1
deleted file mode 100644
index 9abaa46..0000000
--- a/PxShared/buildtools/packman/win-bootstrap/fetch_file_from_url.ps1
+++ /dev/null
@@ -1,37 +0,0 @@
-param(
-[Parameter(Mandatory=$true)][string]$sourceUrl=$null,
-[Parameter(Mandatory=$true)][string]$output=$null
-)
-$source = $sourceUrl
-$filename = $output
-
-$req = [System.Net.httpwebrequest]::Create($source)
-$req.cookiecontainer = New-Object System.net.CookieContainer
-
-Write-Host "Connecting to $source ..."
-$res = $req.GetResponse()
-
-if($res.StatusCode -eq "OK") {
- Write-Host "Downloading ..."
- [int]$goal = $res.ContentLength
- $reader = $res.GetResponseStream()
- $writer = new-object System.IO.FileStream $fileName, "Create"
- [byte[]]$buffer = new-object byte[] 4096
- [int]$total = [int]$count = 0
- do
- {
- $count = $reader.Read($buffer, 0, $buffer.Length);
- $writer.Write($buffer, 0, $count);
- $total += $count
- if($goal -gt 0) {
- Write-Progress "Downloading $url" "Saving $total of $goal" -id 0 -percentComplete (($total/$goal)*100)
- } else {
- Write-Progress "Downloading $url" "Saving $total bytes..." -id 0
- }
- } while ($count -gt 0)
-
- $reader.Close()
- $writer.Flush()
- $writer.Close()
-}
-