I ran the cls alias for Clear-Host in my Powershell ISE session which cleared all output I received in my console from previous commands,
Is it possible for me to retrieve host history and revert the previously run Clear-Host behavior on my console?
While it won't give you the output of the commands, you can use Get-History to get a list of the commands used in the current session.
For more information on each command you can pipe it into Format-List like so:
> Get-History | Format-List -Property *
Id : 1
CommandLine : Get-History
ExecutionStatus : Completed
StartExecutionTime : 7/18/2018 12:07:11 PM
EndExecutionTime : 7/18/2018 12:07:11 PM
Id : 2
CommandLine : echo Hello
ExecutionStatus : Completed
StartExecutionTime : 7/18/2018 12:07:18 PM
EndExecutionTime : 7/18/2018 12:07:18 PM
Id : 3
CommandLine : Get-History
ExecutionStatus : Completed
StartExecutionTime : 7/18/2018 12:07:26 PM
EndExecutionTime : 7/18/2018 12:07:26 PM
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With