Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

How Can I Add a Function to a Windows PowerShell Script?

(image) Hey, Scripting Guy! How can I add a function to a Windows PowerShell script?-- TT(image) (image) (image) Hey, TT. You know, we’re going to do something a little unusual today: we aren’t going to mention the fact that the University of Washington defeated Washington State University in the annual Apple Cup football game. Granted, ...

How Can I Tell Whether a Number is Even or Odd?

(image) Hey, Scripting Guy! How can I tell whether a number is even or odd?-- JO(image) (image) (image) Hey, JO. You know, just this morning the Scripting Guy who writes this column was driving in to work when he heard an advertisement for a store that sells HD TVs. “We don’t confuse you by stocking all the different HD TVs available...

How Can I Add or Subtract Two Hexadecimal Numbers?

(image) Hey, Scripting Guy! How can I add or subtract two hexadecimal numbers?-- PS(image) (image) (image) Hey, PS. You know, according to the old saying there are two things you should never watch being made: laws and sausages. We’d like to add a third item to that list: Hey, Scripting Guy! columns. We knew you’d say that. But ...

How Can I Exit a For Each Loop?

(image) Hey, Scripting Guy! Is there any way to exit a loop in a script?-- MW(image) (image) (image) Hey, MW. You know, when we started writing this column we intended it to be a simple little thing that answered those basic questions so many beginning scripters have: • How can I determine the current date in a script? (Use VBScript...