Page 2 of 2

Re: Using PowerShell to check if URLs are valid

Posted: 07 Sep 2015 06:35
by born2achieve
Hi Meerkat,

thanks for the reply and it worked but this logic takes more time. assume i have 10000 urls in the text file. i tried with foxidrive's sample and it took about a minute to run completely. Is there any better way to speed up this

Re: Using PowerShell to check if URLs are valid

Posted: 07 Sep 2015 06:51
by foxidrive
born2achieve wrote:thanks for the reply and it worked but this logic takes more time.

It's hard to understand how that would take much more time as it's only printing to the console.

Caching may be involved in the timing in your tests - where the DNS lookups are cached and the second time it runs much faster.

I tried to make the powershell pipeline output all requests to the screen, as well as the results to the file, and failed miserably.
write-host and write-output should do it as far as I can see but where and how to include them?
I also tried adding tee but failed.

I don't know a lot about powershell. 8)