Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Scripting >> Powershell >> How to obtain the command history

To display command history

PS: C:\> Get-History

  Id CommandLine
  -- -----------
   1 help
   2 cd \
   3 cls

 

 

How to get more help on History

PS: C:\> help about_History

TOPIC
    about_History

SHORT DESCRIPTION
    Describes how to retrieve and run commands in the command history.


LONG DESCRIPTION
    When you enter a command at the command prompt, Windows PowerShell
    saves the command in the command history. You can use the commands
    in the history as a record of your work. And, you can recall and run the
    commands from the command history.


  History Cmdlets
      Windows PowerShell has a set of cmdlets that manage the command history.

          Cmdlet (Alias)       Description
          -------------------  ------------------------------------------
          Get-History (h)      Gets the command history.

          Invoke-History (r)   Runs a command in the command history.

          Add-History          Adds a command to the command history.

          Clear-History (clh)  Deletes commands from the command history.

....

 

 

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]