Scripting Blog

A place to learn about PowerShell and share stories of automation

Hey, Scripting Guy! How Can I Retrieve All the Values in a Registry Key?

Hey, Scripting Guy! Do you have a script that will enable me to enumerate all the values in a registry key?-- DG Hey, DG. You know, this past weekend the Scripting Guy who writes this column went out to buy doughnuts, a process that took much longer than it should have. Why did it take so long just to buy doughnuts? Because the woman in ...

Hey, Scripting Guy! How Can I Check to See if Two Lines of Text are in a File and, If They Aren’t, Append Those Lines to the File?

Hey, Scripting Guy! Let me first say that your stuff is great. Really helpful scripts mixed with great humor; you guys are pissa's (Australian slang for “funny”). I have a script that needs to open a file and check to see if two lines of text are in that file. If they are, then I leave the file alone; if they aren’t, I need to append ...

Hey, Scripting Guy! How Can I Determine the Currency Symbol in Use on a Computer?

Hey, Scripting Guy! Is there any way to determine the currency symbol that’s in use on a computer?-- IR Hey, IR. Before we get started today we wanted to mention that the Scripting Son picked up his second win in as many pitching starts the other day as the Juanita Rebels rolled past Franklin High School. The Scripting Son is now 2-0 for ...

Hey, Scripting Guy! How Can I Separate The Month From the Year in a Date String Like 122007?

Hey, Scripting Guy! I have a column of data in Microsoft Excel that is formatted as MYYYY (12008 = January 2008) and MMYYYY (122007 = December 2007). I need to split these values into month and year, but I can’t figure out how to do that. Any suggestions?-- DW Hey, DW. Well, it’s finally beginning to warm up here in Scripting Land, ...

Hey, Scripting Guy! How Can I Sort Items Retrieved From a Microsoft Outlook Folder?

Hey, Scripting Guy! I’m trying to write a script that does something with all the email messages in my Outlook Inbox. However, I need to sort those messages by the date they were received, and I can’t figure out how to do that. Can you help?-- SL Hey, SL. You know, no doubt a lot of you who read this column have thought, “The ...