Scripting Blog [archived]

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

Use PowerShell to Read CSV Files and Create Files and Folders

Summary: Learn how to use Windows PowerShell to read CSV files and create files and folders.   Microsoft Scripting Guy Ed Wilson here. This past week has been fun. I enjoy talking about comma-separated value files (CSV) because they are very flexible, and Windows PowerShell makes working with them really easy. One of the cool things that...

Use a CSV File to Populate Parameters of PowerShell Cmdlets

Summary: Learn how to use a CSV file to populate parameters of Windows PowerShell cmdlets.   (image) Hey, Scripting Guy! I have a problem. I would like to be able to read content from a comma-separated value (CSV) file that contains a list of WMI classes and servers that I would like to query. I need to be able to read the CSV file, and ...

Search for and Replace Words in a CSV File by Using PowerShell

Summary: Learn how to search for and replace words in a CSV file by using Windows PowerShell.   (image) Hey, Scripting Guy! I have a comma-separated value (CSV) file that contains user names, user groups, and organizational unit (OU) assignments. The problem is that we are moving one of our office locations, and I need to quickly change ...

Remove Unwanted Quotation Marks from CSV Files by Using PowerShell

Summary: Learn how to remove unwanted quotation marks from a CSV file by using Windows PowerShell.   Microsoft Scripting Guy Ed Wilson here. The fall is rapidly falling down here in Charlotte, North Carolina, in the United States. It is cooling off here, and is around 60 degrees Fahrenheit (15.5 degrees Celsius, according to my conversion...

Use PowerShell to Remove Duplicate Lines from a CSV File

Summary: Learn how to use Windows PowerShell to easily remove duplicates from a CSV file.   (image) Hey, Scripting Guy! I have a comma-separated value (CSV) file that comes from a Microsoft Excel spreadsheet. We use this CSV file to create new users automatically in Active Directory. The problem is that every once in a while, duplicates ...