2,187
edits
m (Added "Variables") |
m (Added "Exceptions and Error Handling") |
||
Line 201: | Line 201: | ||
Write-Host $Rows " inserted into database" | Write-Host $Rows " inserted into database" | ||
</pre> | </pre> | ||
== Exceptions and Error Handling == | |||
* http://huddledmasses.org/trap-exception-in-powershell/ | |||
If you know where the error is likely to occur, then just place an error catcher immediately after it... | |||
<pre> | |||
if (-not $?) { | |||
# Handle error here | |||
} | |||