Month: August 2012

  • Beta testing and error handling

    Here is a simple snippet that you can run to output all exceptions in a script. $ErrorActionPreference = “SilentlyContinue” IWillProduceAnError #—————————————————————- # Debug function, dumps all errors in $Error variable to file #—————————————————————- Function Dump-Errors(){ Param( [Parameter(Position=0, Mandatory = $True)] [String]$Logfile ) $Error | Add-Content $Logfile $Error.Clear() } Dump-Errors -logfile “c:\temp\script.log” If you look at…