Simple try catch statement
# TRY CATCH
Try{
<Code Goes HERE>
}Catch{
$errormessage = $($PSItem.ToString())
Write-Warning 'Error has occurred'
Write-host 'Problem FOUND:' $errormessage -ForegroundColor Red -BackgroundColor White
}
Here is updated ISE profile. You can use it to built your own and make few adjustments. # STARTING ADDS-ON MENU # ...
No comments:
Post a Comment