Scripting Blog [archived]

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

Hey, Scripting Guy! How Can I Use a Disconnected Recordset in Windows PowerShell?

(image) Hey, Scripting Guy! How can I use a disconnected recordset in Windows PowerShell? I’m able to create the recordset without any problem, but I can’t figure out how to reference the fields and values in that recordset.-- JVDL(image) (image) (image) Hey, JVDL. Well, we must say, we’re impressed by how cool, calm, and collected ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Sort a CSV File?

(image) Hey, Scripting Guy! have a comma-separated values file that includes several different fields. I’d like to be able to read this file from Windows PowerShell and then sort the information on one (or maybe more) of these fields. However, I can’t seem to get this to work. Any suggestions?-- DW(image) (image) (image) Hey, DW. ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Retrieve the Non-Unique Items in a List?

(image) Hey, Scripting Guy! I understand that I can use Windows PowerShell and the Get-Unique cmdlet to determine which items are unique in a collection. However, I want to do the opposite: I want to determine which items are not unique in a collection. How can I do that?-- YE (image) (image) (image) Hey, YE. You know, yesterday afternoon, ...

Hey, Scripting Guy! How Can I Use Windows PowerShell to Replace Characters in a Text File?

(image) Hey, Scripting Guy! Using Windows PowerShell, how can I replace all the asterisks in a text file with some other character?-- RC (image) (image) (image) Hey, RC. You know, a lot of people ask the Scripting Guy who writes this column, “How do you do it? How do you manage to write a new column each and every day?” (Of ...

Hey, Scripting Guy! How Can I Add a Record to a Database Using Windows PowerShell?

(image) Hey, Scripting Guy! Awhile back you showed us how we could use Windows PowerShell to retrieve data from a Microsoft Access database. I’m now trying to add data to a database using PowerShell, but I can’t get the script to work. Any chance you could show me how to add a record to a database using Windows PowerShell?-- AB(image) (...