Okay, so, I've put it on my to-do list to actually post something here for the last...wait, it's been *three weeks* already?!? Time sure does fly...
Here I will detail upcoming changes to the site, as well as a status update on the error handling series.
Read More
It happens: you run a script or execute a command, and something doesn't work quite right. You get an ugly red error. Now what?
There are many ways to handle this. When you're sitting at the console, frequently it comes down to simply reading the error message and figuring out what you forgot or mistyped. These are often the easiest errors to deal with just for the fact that they're interactive by nature, so you get the opportunity to try other things until you get the results you're looking for before proceeding.
Things get a lot more complicated, however, when you're writing a script, especially one that is meant to run without someone sitting at a console to see the errors. At least if the script is being run manually, the person sitting at the console will be able to see that something did go wrong; when it's unattended, though, frequently you wind up losing valuable clues as to what went wrong, so you need to think about how your script could fail and account for that ahead of time with error handling.
Read More
It happens to all of us: our perfect script will run in to something it doesn't understand, doesn't know how to deal with, and out comes the red text. It was probably something simple, like someone mistyped the command, or that file was moved by someone trying to be "helpful".
Whatever the reason, you find yourself looking at a garbled mess of angry red text. Or, even worse: it was a script you had running automatically, and now you have no idea what went wrong. Fortunately, PowerShell comes with many ways to deal with errors.
Error Handling isn't a sexy or fun topic, but it is vital to writing good scripts. In this series, I hope to give you enough to get started.
Read More