Quantcast
Channel: powershell 2.0 try catch how to access the exception - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by stej for powershell 2.0 try catch how to access the exception

Try something like this:try { $w = New-Object net.WebClient $d = $w.downloadString('http://foo')}catch [Net.WebException] { Write-Host $_.Exception.ToString()}The exception is in the $_ variable. You...

View Article



powershell 2.0 try catch how to access the exception

This is the try catch in PowerShell 2.0$urls = "http://www.google.com", "http://none.greenjump.nl", "http://www.nu.nl"$wc = New-Object System.Net.WebClient foreach($url in $urls){ try { $url...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images