What are the two types of PowerShell command history and how do they differ?
The two types are **Get-History** and **Get-PSReadlineOption** (PSReadline). Get-History records commands only for the current PowerShell session and is cleared when the process exits, while PSReadline saves all commands to a persistent file at `%appdata%\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt`. This distinction is crucial in penetration testing because it determines whether an attacker can access history after the session ends.
PowerShell command historyGet-HistoryPSReadlinepenetration testing