Showing results for July 2010 - Scripting Blog [archived]

Jul 31, 2010
0
1

Using Windows PowerShell to Determine if a Laptop Is on Battery Power

ScriptingGuy1
ScriptingGuy1

  Microsoft Scripting Guy Ed Wilson here. It is time for another road trip. This time we are heading to Asheville, North Carolina for the Blue Ridge Classic Horse Show. Somewhere deep in my Scripting Guy lineage is an association with Kentucky, which is considered a horse state. Horse shows are really cool. My significant other and I went to a...

Scripting Guy!Windows PowerShellWeekend Scripter
Jul 29, 2010
0
0

How to Add Data to an XML File Using Windows PowerShell

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I need to be able to use Windows PowerShell to add data to an XML file. Unfortunately, there is no Add-XML cmdlet available. I thought about using the Windows PowerShell Add-Content cmdlet and trying to write my data to the file, but it never worked correctly. I never could get all of those angle thingies to line up properly. ...

Scripting Guy!Windows PowerShellscripting techniques
Jul 28, 2010
0
0

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

Scripting Guy!Windows PowerShellscripting techniques
Jul 27, 2010
0
0

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

Scripting Guy!Windows PowerShellscripting techniques
Jul 26, 2010
0
0

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

Scripting Guy!Windows PowerShellscripting techniques