Showing results for string manipulation - Scripting Blog [archived]

Jul 28, 2010
Post comments count0
Post likes count0

Writing Double Quotation Marks to a Text File Using Windows PowerShell

ScriptingGuy1
ScriptingGuy1

  Hey, Scripting Guy! I need to be able to write double quotation marks to a text file using Windows PowerShell. I know that in VBScript it was really annoying to do this because the quotation marks ended up getting confused with the quotation mark that was used to indicate the start of a string; when the next quotation mark was seen, VBScri...

Scripting Guy!Windows PowerShellscripting techniques
Jul 27, 2010
Post comments count0
Post likes count0

Deleting Extra Returns and Line Feeds from a Text File Using Windows PowerShell

ScriptingGuy1
ScriptingGuy1

  Hey, Scripting Guy! Is it possible to use Windows PowerShell to groom a text file by deleting extra returns and line feeds it may contain? Here is the deal. I have a file that we need to download each day. This file contains updated prices for commodities used in our manufacturing operation. We use the updated commodity pricing to determin...

Scripting Guy!Windows PowerShellscripting techniques
Jul 26, 2010
Post comments count0
Post likes count0

Parsing an AuditPol.exe Report with Windows PowerShell 2.0

ScriptingGuy1
ScriptingGuy1

  Hey, Scripting Guy! I have been using AuditPol.exe to verify the audit policy that is configured on our network. The problem is that the report that is generated has a lot of text, and it is not easy to see exactly what is being audited or not. Is it possible to use Windows PowerShell 2.0 to parse the report generated by AuditPol.exe to mak...

Scripting Guy!Windows PowerShellscripting techniques
Jul 1, 2010
Post comments count0
Post likes count0

Hey, Scripting Guy! How can I Migrate a VBScript to Windows PowerShell that parses a log file for errors?

ScriptingGuy1
ScriptingGuy1

    Q: Hey Scripting Guy! I need to migrate a VBScript to Windows PowerShell 2.0 that I use to parse a log file for errors that occur during a specific operation. I am only interested in the errors, not the success statements. Because this log has a tendency to grow rather large, I would like to write the failure events back to the...

Scripting Guy!Windows PowerShellscripting techniques
Jun 30, 2010
Post comments count0
Post likes count0

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

ScriptingGuy1
ScriptingGuy1

    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 helping th...

Scripting Guy!Windows PowerShellscripting techniques