> For the complete documentation index, see [llms.txt](https://rfc1918.gitbook.io/offsec/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rfc1918.gitbook.io/offsec/discovery/juicy-files/powershell-history.md).

# PowerShell history

The PowerShell history can contain sensitive information such as password enter through commandline ex.

## Read history file

You can find the full history in the following text file:

```powershell
%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
```

or use this command to get the full path:

```powershell
(Get-PSReadlineOption).HistorySavePath
```

## Clearing history file

```powershell
Remove-Item (Get-PSReadlineOption).HistorySavePath
```

## Do you want to set another location for this file?

Use the following command with -HistorySavePath parameter to specify a new path:

```powershell
Set-PSReadlineOption –HistorySavePath C:\Temp\History.txt
```
