Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to ensure the $webClient.DownloadString(url) is really completed (all downloaded)?

$
0
0

Have the following powershell script (v4)

 

$webClient = new-object System.Net.WebClient

$startTime = get-date

$webClient.DownloadString(http://localhost/a.aspx)

$endTime = get-date

($endTime - $startTime).TotalSeconds + " seconds"

 

The question is, how to ensure the $webClient.DownloadString is really completed? I mean, if there is a iframe or sub-call within a.aspx, then how to ensure to capture the $endTime only when everything are completed in that page (a.aspx)?

Thanks.

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles