Scripting Blog [archived]

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

Hey, Scripting Guy! How can I use Windows PowerShell to Search a Text File for multiple strings?

  (image)   Q: Hey Scripting Guy! I need help migrating a script from VBScript to Windows PowerShell 2.0. The VBScript is one that I based upon an old Hey Scripting Guy! article. I use it to search a text file for specific words. If the words are found, the script displays a message stating this fact. I do not want to learn ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Create a Text File with Fixed-Length Lines?

  (image)   (image) Hey, Scripting Guy! I am trying to learn Windows PowerShell 2.0, but I am having some issues when it comes to string manipulation. I have been a faithful reader of the Scripting Guys for several years, and I have found many of the scripts to be critical in my business environment. I wish I could simply ...

Hey, Scripting Guy! How Can I Create File Names Based on Their Time Stamp?

(image) Hey, Scripting Guy! How can I create a file name from the date? I have this application that creates a log file, and every hour I would like to save that log file as a file whose name is generated from the current time stamp. Can this be done?- RH(image) (image) Hi RH, Ever since I read your e-mail message, I have had this old ...

Hey, Scripting Guy! How Can I Create Passwords for My Users?

(image) Hey, Scripting Guy! I am trying to create a bunch of users via script, but I am having problems dealing with their passwords. I do not want to give everyone the same password, and I do not want to have to manually create a hundred passwords and store them in a file, so I am nearly at a loss. I have seen some password generator ...