about_History - PowerShell


 

Describes how to retrieve and run commands in the command history. (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.

Keyboard Shortcuts for Managing History
In the Windows PowerShell console, you can use the following shortcuts
to manage the command history.

For other host applications, see the product documentation.

Use this key To perform this action
------------- ----------------------------------------------
UP ARROW Displays the previous command.

DOWN ARROW Displays the next command.

F7 Displays the command history.
To hide the history, press ESC.

F8 Finds a command. Type one or more characters,
and then press F8. For the next instance,
press F8 again.

F9 Find a command by history ID. Type the history
ID, and then press F9. To find the ID, press F7.

MaximumHistoryCount
The $MaximumHistoryCount preference variable determines the maximum
number of commands that Windows PowerShell saves in the command history.
The default value is 64, meaning that Windows PowerShell saves the 64
most recent commands, but you can change the value of the variable.

For example, the following command raises the $MaximumHistoryCount to
100 commands:

$MaximumHistoryCount = 100

To apply the setting, restart Windows PowerShell.

To save the new variable value for all your Windows PowerShell
sessions, add the assignment statement to a Windows PowerShell profile.
For more information, see about_Profiles.

Order of Commands in the History
Commands are added to the history when the command finishes executing,
not when the command is entered. If commands take some time to be
completed, or if the commands are executing in a nested prompt, the
commands might appear to be out of order in the history. (Commands
that are executing in a nested prompt are completed only when you exit
the prompt level.)

SEE ALSO
about_Line_Editing
about_Variables
about_Preference_Variables

C:\Windows>powershell get-help about_If -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows 10, 8.1, 8, 7, Vista / Windows Server 2016, 2012, 2008
»»»» ColorConsole








Windows-10





Windows-10

... facebook.de
... Windows-10 FAQ
... Windows-10 Info


Become a Sponsor
... Your button here?





PowerShell: Describes how to retrieve and run commands in the command history.

HTTP: ... PS_Windows/en/about_History.htm
0.202
13398

What is TMC in a car radio?

 /

Change the default action of pressing WIN+E to start Q-Dir and not explorer.exe on Windows 7 and Windows 8?

 /

Add folder with subfolder and files to change the timestamp!

 /

Warum befinden sich Dateien in der bei Neustart Löschen Liste auf Windows 10?

 /

Download Outlook or Mail for windows 7!

 /

Activate Win 8 remote support for remote desktop connections in Windows-8 ?

 /

Color filter for files and folders in Explorer views eg MP3, but how?

 /

Download NoLockScreen.OK for Windows!

 /

CPU-Auslastung über die cmd.exe Windows-Eingabeaufforderung abfragen?

 /

How to change the activation key to activate Windows 10, 8.1, Seven?

 /

Why can I not delete a VHD file in Windows 8.1 or 10?

 /

Print multiple pictures on one page, Windows 10!

 /