About this tag
The export-csv tag on WindowsForum.com covers the use of the Export-CSV cmdlet in PowerShell, particularly for saving session history. A recurring theme is creating a persistent command history by exporting PowerShell session history to a CSV file and importing it on startup. This approach allows users to retain up to 1KB of history across sessions, mimicking Unix-like .bash_history functionality. The tag content focuses on practical scripting techniques for Windows PowerShell, including profile configuration and automation of history management.
  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...
  2. H

    Windows Vista How to Add History to Windows PowerShell

    Ever wish you had history like in unix with .bash_history? Here is some code that you can put in your profile file that defines a function BYE which saves off your sessions history into a History.CSV file in your home directory and then adds that to your history when you startup the next...