Here is simple example of try and 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 } |
Casey DeDeal
https://simplepowershell.blogspot.com
https://cloudsec365.blogspot.com
https://msazure365.blogspot.com
https://twitter.com/Message_Talk
https://simplepowershell.blogspot.com
https://cloudsec365.blogspot.com
https://msazure365.blogspot.com
https://twitter.com/Message_Talk
No comments:
Post a Comment