Write-Error is a pretty daunting cmdlet. It dumps some pretty useful information to screen. Useful, that is, for the scripter. For the non-PowerShell-guru end user, it can be pretty intimidating.
Write-Host -ForegroundColor Red might be a better option, but it doesn't populate the $Error variable. Lastly, and this is just my preference, I'd like to have some data about where the error occurred, but I want it to look nice for the user. This includes the script name and function name. Instead...(read more)
↧