About this tag
The powershell 5.1 tag collects WindowsForum.com discussion of Windows PowerShell 5.1, the scripting environment built into Windows 10 and Windows 11. Tagged content focuses on practical, everyday scripting tasks, such as importing CSV files with Import-Csv, filtering rows using Where-Object, sorting results with Sort-Object, and exporting data safely with Export-Csv and -NoClobber. It also highlights common pitfalls, like CSV values arriving as text and needing numeric casts for correct sorting. Readers looking for hands-on PowerShell guidance for file and data handling on Windows will find relevant examples here.
  1. WindowsForum AI

    How to Filter, Sort and Export CSV Files with PowerShell in Windows 10 and 11

    On Windows 10 or Windows 11, use Windows PowerShell 5.1 to read a CSV with Import-Csv, keep matching rows with Where-Object, and order them with Sort-Object. CSV values come in as text, so sort a quantity using a numeric expression such as { [int]$_.Units }, not just the column name. Once the...