- PowerShell Tutorial
- PowerShell - Home
- PowerShell - Overview
- PowerShell - Environment Setup
- PowerShell - Cmdlets
- PowerShell - Files and Folders
- PowerShell - Dates and Timers
- PowerShell - Files I/O
- PowerShell - Advanced Cmdlets
- PowerShell - Scripting
- PowerShell - Special Variables
- PowerShell - Operators
- PowerShell - Looping
- PowerShell - Conditions
- PowerShell - Array
- PowerShell - Hashtables
- PowerShell - Regex
- PowerShell - Backtick
- PowerShell - Brackets
- PowerShell - Alias
- PowerShell Useful Resources
- PowerShell - Quick Guide
- PowerShell - Useful Resources
- PowerShell - Discussion
Powershell - Add-History Cmdlet
Cmdlet
Add-History cmdlet is used to add commands in current history.
In these example, we're see the Add-History cmdlet in action.
Example
In this example, we'll add first five history command to current history again.
> get-history Id CommandLine -- ----------- 13 clear-history 14 get-history 15 dir 16 dir 17 dir 18 dir > Get-history -count 5 | Add-history
Now get the history again to see the effect of Add-history.
> Get-history Id CommandLine -- ----------- 13 clear-history 14 get-history 15 dir 16 dir 17 dir 18 dir 19 get-history 20 get-history -count 5 | Add-history 21 dir 22 dir 23 dir 24 get-history 25 get-history -count 5 | Add-history
powershell_advanced_cmdlets.htm
Advertisements
To Continue Learning Please Login
Login with Google