Contact Info

Crumbtrail » Administration » Powershell » Powershell 2.0 » Add-History

Add-History - Powershell 2.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.


Short description
Appends entries to the session history.

Add-History [[-InputObject] <PSObject[]>] [-PassThru] [<CommonParameters>]

The Add-History cmdlet adds entries to the end of the session history, that is, the list of commands entered during the current session. 
You can use the Get-History cmdlet to get the commands and pass them to Add-History, or you can export the commands to a CSV or XML file, then import the commands, and pass the imported file to Add-History. You can use this cmdlet to add specific commands to the history or to create a single history file that includes commands from more than one session.