Scripting Blog [archived]

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

Use the Set-WmiInstance PowerShell Cmdlet to Ease Configuration

Summary: Learn how to use the Set-WmiInstance Windows PowerShell cmdlet to ease configuration of computers.   (image) Hey, Scripting Guy! I was using the Get-Command cmdlet to look at what things I can do with Windows PowerShell, and I noticed a cmdlet called Set-WmiInstance. I looked at the help, but I don’t get it. What is the big...

Use PowerShell to Find the Top Values Returned by WMI

Summary: Learn how to use Windows PowerShell to slice and dice WMI data in an easy, SQL-like fashion.   (image) Hey, Scripting Guy! Does the WMI select statement have any other clauses like SQL does? For example, can I just select top 10 * from to get a sample of the collection rather than doing a * for the entire collection? —UJ &...

Convert a Semicolon-Delimited File to a CSV File

Summary: Learn how to convert easily a semicolon delimited file into a CSV file using Windows PowerShell.   (image) Hey, Scripting Guy! I have a problem at work, and I hope you can help. We have an application that writes one log file every four hours. These log files are formatted with semicolons, which makes them a pain to work with. My...

Easily Remove Columns from a CSV File by Using PowerShell

Summary: Use a super simple, one-line command to remove columns easily from a CSV file using Windows PowerShell.   (image) Hey, Scripting Guy! I have a CSV file from which I need only two of eight columns. Can Windows PowerShell delete certain columns? I have searched the Internet for days with no luck. —RK   (image) Hello RK, ...