- PowerShell 教程
- PowerShell - 主頁
- PowerShell - 概述
- PowerShell - 環境設定
- PowerShell - Cmdlet
- PowerShell - 檔案和資料夾
- PowerShell - 日期和時間
- PowerShell - 檔案 I/O
- PowerShell - 高階 Cmdlet
- PowerShell - 指令碼
- PowerShell - 特殊變數
- PowerShell - 運算子
- PowerShell - 迴圈
- PowerShell - 條件
- PowerShell - 陣列
- PowerShell - 雜湊表
- PowerShell - 正則表示式
- PowerShell - 反引號
- PowerShell - 括號
- PowerShell - 別名
- PowerShell 有用資源
- PowerShell - 快速指南
- PowerShell - 有用資源
- PowerShell - 討論
Powershell - Add-History Cmdlet
Cmdlet
Add-History Cmdlet 用於向當前歷史記錄中新增命令。
在這些示例中,我們將看到 Add-History Cmdlet 的實際操作。
示例
在此示例中,我們將前五個歷史記錄命令再次新增到當前歷史記錄中。
> get-history Id CommandLine -- ----------- 13 clear-history 14 get-history 15 dir 16 dir 17 dir 18 dir > Get-history -count 5 | Add-history
現在重新獲取歷史記錄以檢視 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
廣告