In the Catch statement block, you can reference the text of the error message with the $_ variable. For example, include these statements in the Catch block
write-host "Error text: " $_
write-host "Exception: " $_.Exception.GetType()
FYI: The MSDN example code above includes the statement:
$wc.DownloadFile("http://www.contoso.com/MyDoc.doc")
The .DownloadFile method needs a second parameter which specifies the local target file. To test the catch blocks in the MSDN example, include a second parm such as "c:\DummyFile.doc"