Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Read Just the Last Line of a Text file?

Hey, Scripting Guy! How can I read just the last line of a text file?-- BM Hey, BM. You know, if you’ve ever wondered how Hey, Scripting Guy! differs from other daily columns (like, say, Dear Abby), well, here’s one way. Suppose someone writes Dear Abby and says this:Dear Abby:My life is all messed up and I need to do something about ...

How Can I Determine if a Computer is Running Windows Server 2003 and if Service Pack 1 is Installed?

Hey, Scripting Guy! How can I determine whether or not a computer is running Windows Server 2003 and, if so, whether Service Pack 1 is installed?-- TW Hey, TW. You know, we Scripting Guys always get a kick out of questions like this. Not because there’s anything wrong with the question, mind you. It’s just that many of the people we ...

How Can I Right-Align a Single Column in a Word Table?

Hey, Scripting Guy! How can I right-align a single column in a Word table?-- RC Hey, RC. You know, one of the phrases no one ever wants to hear is “This isn’t as bad as it looks.” After all, that’s what your business partner says when you discover he’s been using the company payroll to buy lottery tickets. “This isn’t as bad ...