{
	"id": "0b2d8c2b-1f08-435b-8b5c-3d9ec87f02fa",
	"created_at": "2026-04-06T00:11:49.242824Z",
	"updated_at": "2026-04-10T03:21:49.313729Z",
	"deleted_at": null,
	"sha1_hash": "02c7a3fec0d32daf109149ea4d800c41799a2768",
	"title": "about_History - PowerShell",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 52796,
	"plain_text": "about_History - PowerShell\r\nBy sdwheeler\r\nArchived: 2026-04-05 18:41:28 UTC\r\nShort description\r\nDescribes how to get and run commands in the command history.\r\nLong description\r\nWhen you enter a command at the command prompt, PowerShell saves the command in the command history.\r\nYou can use the commands in the history as a record of your work. And, you can recall and run the commands\r\nfrom the command history.\r\nPowerShell has two different history providers: the built-in history and the history managed by the PSReadLine\r\nmodule. The histories are managed separately, but both histories are available in sessions where PSReadLine is\r\nloaded.\r\nUsing the PSReadLine history\r\nThe PSReadLine history tracks the commands used in all PowerShell sessions. The history is written to a central\r\nfile per host. That history file is available to all sessions and contains all past history. The history is not deleted\r\nwhen the session ends. Also, that history cannot be managed by the *-History cmdlets. For more information,\r\nsee about_PSReadLine.\r\nUsing the built-in session history\r\nThe built-in history only tracks the commands used in the current session. The history is not available to other\r\nsessions and is deleted when the session ends.\r\nHistory Cmdlets\r\nPowerShell has a set of cmdlets that manage the command history.\r\nCmdlet Alias Description\r\nGet-History h Gets the command history.\r\nInvoke-History r Runs a command in the command history.\r\nAdd-History Adds a command to the command history.\r\nClear-History clhy Deletes commands from the command history.\r\nhttps://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_history?view=powershell-7.5\r\nPage 1 of 3\n\nKeyboard Shortcuts for Managing History\r\nIn the PowerShell console, you can use the following shortcuts to manage the command history.\r\nUpArrow - Displays the previous command.\r\nDownArrow - Displays the next command.\r\nF7 - Displays the command history.\r\nESC - To hide the history.\r\nF8 - Finds a command. Type one or more characters then press F8. Press F8 again the next instance.\r\nF9 - Find a command by history ID. Type the history ID then press F9. Press F7 to find the ID.\r\n# \u003cstring\u003e Tab - Search the history for *\u003cstring\u003e* and returns the most recent match. If you press Tab\r\nrepeatedly, it cycles through the matching items in your history.\r\nNote\r\nThese key bindings are implemented by the console host application. Other applications, such as Visual Studio\r\nCode or Windows Terminal, can have different key bindings. The bindings can be overridden by the PSReadLine\r\nmodule. PSReadLine loads automatically when you start a PowerShell session. With PSReadLine loaded, F7 and\r\nF9 are not bound to any function. PSReadLine does not provide equivalent functionality. For more information,\r\nsee about_PSReadLine.\r\nMaximumHistoryCount\r\nThe $MaximumHistoryCount preference variable determines the maximum number of commands that PowerShell\r\nsaves in the command history. The default value is 4096.\r\nFor example, the following command lowers the $MaximumHistoryCount to 100 commands:\r\n$MaximumHistoryCount = 100\r\nTo apply the setting, restart PowerShell.\r\nTo save the new variable value for all your PowerShell sessions, add the assignment statement to a PowerShell\r\nprofile. For more information about profiles, see about_Profiles.\r\nFor more information about the $MaximumHistoryCount preference variable, see about_Preference_Variables.\r\nOrder of Commands in the History\r\nCommands are added to the history when the command finishes executing, not when the command is entered. If\r\ncommands take some time to be completed, or if the commands are executing in a nested prompt, the commands\r\nmight appear to be out of order in the history. Commands that are executing in a nested prompt are completed only\r\nwhen you exit the prompt level.\r\nSee also\r\nhttps://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_history?view=powershell-7.5\r\nPage 2 of 3\n\nabout_Line_Editing\r\nabout_Preference_Variables\r\nabout_Profiles\r\nabout_PSReadLine\r\nabout_Variables\r\nSource: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_history?view=powershell-7.5\r\nhttps://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_history?view=powershell-7.5\r\nPage 3 of 3",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_history?view=powershell-7.5"
	],
	"report_names": [
		"about_history?view=powershell-7.5"
	],
	"threat_actors": [],
	"ts_created_at": 1775434309,
	"ts_updated_at": 1775791309,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/02c7a3fec0d32daf109149ea4d800c41799a2768.pdf",
		"text": "https://archive.orkl.eu/02c7a3fec0d32daf109149ea4d800c41799a2768.txt",
		"img": "https://archive.orkl.eu/02c7a3fec0d32daf109149ea4d800c41799a2768.jpg"
	}
}