Skip to main content

Powershell: Get-History

Illustrated: HISTORY

Get-History - Gets a list of the commands entered during the current session.

Alias: history, h, or ghy.

C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

h : Get list of commands entered in current session
r 12 : Run command with Id 12 in current history list
ihy 12 : Run command with Id 12 in current history list
Get-History
history

or simply type 'h' instead of 'history'

h

List the command with id 1

h 1

Add '-count n' or '-c n' to list the last n run command

h -c 1

Run command with id 5 in the history list

ihy 5

Related commands

Linux command: history

Popular posts from this blog

HTML5: Complete Table Structure

Photo Credit: Gerald - pixabay.com   <table> <caption style="caption-side:bottom;" >Caption here</caption> <thead> <tr> <th>Header1</th> <th>Header2</th> ... </tr> </thead> <tbody> <tr> <td>Column1</td> <td>Column2</td> ... </tr> ... </tbody> <tfoot>Footer here</tfoot> </table>

VMware Workstation: vmrun.exe

Using vmrun.exe to manage VMs on VMware Workstation

Chrome: Common Keyboard Shortcuts

Get more productive by learning and using shortcuts in Chrome browser.