/ Published in: Windows PowerShell
Setup one timeout value for downloadstring method of WebClient Class in PowerShell
Property Timeout of WebClient isn't public, but we can inhertis from him and change this property in the new class
Inspired by: One article on What Was I Thinking? (http://goo.gl/IQQazD)
Thanks also to Stefan Goßner (http://goo.gl/T6RZJC)
run sample: powershell.exe -executionpolicy bypass .\DownloadString.ps1 100 "http://www.google.es"
run sample: powershell.exe -executionpolicy bypass .\DownloadString.ps1 -url "www.google.es" -timeout -1
Property Timeout of WebClient isn't public, but we can inhertis from him and change this property in the new class
Inspired by: One article on What Was I Thinking? (http://goo.gl/IQQazD)
Thanks also to Stefan Goßner (http://goo.gl/T6RZJC)
run sample: powershell.exe -executionpolicy bypass .\DownloadString.ps1 100 "http://www.google.es"
run sample: powershell.exe -executionpolicy bypass .\DownloadString.ps1 -url "www.google.es" -timeout -1