Scripting Blog

A place to learn about PowerShell and share stories of automation

Hey, Scripting Guy! How can I Convert a VBScript That Searches Text Files into Windows PowerShell?

    Q: Hey Scripting Guy! I need to convert a VBScript into Windows PowerShell 2.0. The script reads the first line of all text files that are in a particular folder, and if a specific word is in that file, it moves the text file to an archive folder. -- AO A: Hello AO, Microsoft Scripting Guy Ed Wilson here, I have been ...

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

    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 Windows ...

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

    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 translate the ...

Hey, Scripting Guy! Weekend Scripter: Timing the Windows PowerShell Pipeline

    Microsoft Scripting Guy Ed Wilson here. I decided to get up early this morning and head out with my laptop, a camera, and my panama hat. My destination? Battery Park. The Scripting Wife and I are in Charleston, South Carolina, for the weekend, and I thought it would be a great time to write some scripts. The Scripting ...

Weekend Scripter: Playing Around with the Windows PowerShell Tokenizer

  //   Microsoft Scripting Guy Ed Wilson here. Once again, the Scripting Wife and I are on the road. This weekend we are heading to Charleston, South Carolina, to hang out and to see a couple music groups. The Scripting Wife is driving, and I am playing around with Windows PowerShell. We have my Zune HD plugged into our car ...

Feedback usabilla icon