
Powershell download large file - not understand
Powershell download large file - suggest you
How to download large files using powershell (.zip,.tar)

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.
You should upgrade or use an alternative browser.
Using System.net.WebClient I am able to download files from internet
programatically, but it fails with timeout when working on large
downloads and does not have proxy property also.
So i tried c# code below and it works:
http://www.developer.com/net/net/article.php/3340151
Can someone help translate this into powershell...
so far this is what i have..
$webRequest = [system.Net.WebRequest]::Create($url)
$webRequest.TimeOut = -1
$webRequest.Proxy = New-Object System.Net.WebProxy("proxyserver:8080",
$true)
#$webRequest.Credentials =
[System.Net.CredentialCache]::DefaultCredentials12345 #TODO
$webResponse = $webRequest.GetResponse()
[int64]$contentLength = $webResponse.ContentLength
$contentLength
$requestStream = $webResponse.GetResponseStream()
programatically, but it fails with timeout when working on large
downloads and does not have proxy property also.
So i tried c# code below and it works:
http://www.developer.com/net/net/article.php/3340151
Can someone help translate this into powershell...
so far this is what i have..
$webRequest = [system.Net.WebRequest]::Create($url)
$webRequest.TimeOut = -1
$webRequest.Proxy = New-Object System.Net.WebProxy("proxyserver:8080",
$true)
#$webRequest.Credentials =
[System.Net.CredentialCache]::DefaultCredentials12345 #TODO
$webResponse = $webRequest.GetResponse()
[int64]$contentLength = $webResponse.ContentLength
$contentLength
$requestStream = $webResponse.GetResponseStream()
My Computer
Harry,
By (bad) experience, I gave up using that method for large file downloads
like zip or iso.
Instead, I used BITS protocol over HTTP.
You can access it programmatically using the cmd-line BITSADMIN and write a
PoSh wrapper around it or use the cmdlets of PoSh V2:
http://blogs.msdn.com/powershell/archive/2009/01/11/transferring-large-files-using-bits.aspx
It is proxy friendly and can run in the background (as a service) if
necessary.
--
Marc [MCSE, MCTS, MVP]
[Heureux celui qui a pu pénétrer les causes secrètes des choses]
[Blog: http://www.marc-antho-etc.net/blog/]
"Harry" <[email protected]> wrote in message
news:[email protected]
__________ Information from ESET NOD32 Antivirus, version of virus signature database 3994 (20090407) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
By (bad) experience, I gave up using that method for large file downloads
like zip or iso.
Instead, I used BITS protocol over HTTP.
You can access it programmatically using the cmd-line BITSADMIN and write a
PoSh wrapper around it or use the cmdlets of PoSh V2:
http://blogs.msdn.com/powershell/archive/2009/01/11/transferring-large-files-using-bits.aspx
It is proxy friendly and can run in the background (as a service) if
necessary.
--
Marc [MCSE, MCTS, MVP]
[Heureux celui qui a pu pénétrer les causes secrètes des choses]
[Blog: http://www.marc-antho-etc.net/blog/]
"Harry" <[email protected]> wrote in message
news:[email protected]
> Using System.net.WebClient I am able to download files from internet
> programatically, but it fails with timeout when working on large
> downloads and does not have proxy property also.
>
> So i tried c# code below and it works:
> http://www.developer.com/net/net/article.php/3340151
>
>
> Can someone help translate this into powershell...
>
>
> so far this is what i have..
>
>
> $webRequest = [system.Net.WebRequest]::Create($url)
> $webRequest.TimeOut = -1
> $webRequest.Proxy = New-Object System.Net.WebProxy("proxyserver:8080",
> $true)
> #$webRequest.Credentials =
> [System.Net.CredentialCache]::DefaultCredentials12345 #TODO
>
>
> $webResponse = $webRequest.GetResponse()
>
>
> [int64]$contentLength = $webResponse.ContentLength
> $contentLength
>
>
> $requestStream = $webResponse.GetResponseStream()
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 3994 (20090407) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 3994 (20090407) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
My Computer
The BITS stuff in PowerShell 2 is excellent. If you can't use that, one
alternative is the Get-WebFile script on PoshCode,org ... and another
would be the HttpRest script (which depends on an external open source
dll) which has "File" option so you can:
Invoke-Http Get $URL | Receive-Http File
I think both of those just use whatever proxy your "Internet Settings"
control panel currently specifies...
I know Get-WebFile actually shows a "Progress" while downloading ...if
nothing else it will show you what you need to do to read from a stream
and write a file.
--
Joel "Jaykul" Bennett
http://HuddledMasses.org
Lognoul Marc [MVP] wrote:
alternative is the Get-WebFile script on PoshCode,org ... and another
would be the HttpRest script (which depends on an external open source
dll) which has "File" option so you can:
Invoke-Http Get $URL | Receive-Http File
I think both of those just use whatever proxy your "Internet Settings"
control panel currently specifies...
I know Get-WebFile actually shows a "Progress" while downloading ...if
nothing else it will show you what you need to do to read from a stream
and write a file.
--
Joel "Jaykul" Bennett
http://HuddledMasses.org
Lognoul Marc [MVP] wrote:
> Harry,
>
> By (bad) experience, I gave up using that method for large file
> downloads like zip or iso.
>
> Instead, I used BITS protocol over HTTP.
>
> You can access it programmatically using the cmd-line BITSADMIN and
> write a PoSh wrapper around it or use the cmdlets of PoSh V2:
> http://blogs.msdn.com/powershell/archive/2009/01/11/transferring-large-files-using-bits.aspx
>
>
> It is proxy friendly and can run in the background (as a service) if
> necessary.
>
My Computer
- This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
-
-
-