xxxxxxxxxx
Get-History | Format-List -Property *
#By default, the PowerShell in Windows 10 saves the last 4096 commands that are stored in a plain text file located in the profile of each user:
get-content $env:USERPROFILE\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
xxxxxxxxxx
#cmd
type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
#Powershell
type $Env:userprofile\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
search powershell history for a command
xxxxxxxxxx
type $Env:userprofile\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt | findstr foo
Search for "foo" command in PowerShell history. Replace "foo" with the command you're searching for