powershell - Point of Write-Error in Catch block -
if catching exceptions display error in more user friendly way, there point in using write-error on write-host? write-error show exception same way if didn't catch right?
one reason you'd want use write-error
on write-host
written powershell error stream, , can redirected if wanted later (e.g. running script scheduled task, , want capture output log file).
Comments
Post a Comment