cat (Get-PSReadLineOption).HistorySavePath - wyświetl historię poleceń Powershella
tty1 · powershell
PS> cat (Get-PSReadLineOption).HistorySavePath
#Powershell#RedTeam#BlueTeam#ThreatHunting
Get-PSReadLineOption zwróci kilka ustawień dotyczących konsoli, w HistorySavePath zawarta jest ścieżka do historii poleceń - analogicznie do ~/.bash_history znanego unixowcom.
Zwyczajowo na Windowsach będzie to:
PS C:\Users\drg> (Get-PSReadLineOption).HistorySavePath
C:\Users\drg\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
PS C:\Users\drg>
a na *nixach:
PS /Users/drg> (Get-PSReadLineOption).HistorySavePath
/Users/drg/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
PS /Users/drg>