Quantcast
Channel: MSDN Blogs
Viewing all articles
Browse latest Browse all 35736

Out-Error, the User-friendlier Write-Error

$
0
0
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)

Viewing all articles
Browse latest Browse all 35736

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>