
- 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 - Invoke-History Cmdlet
Cmdlet
Invoke-History Cmdlet 用於運行當前會話中已執行過的命令。
在這些示例中,我們將看到 Invoke-History Cmdlet 的實際操作。
示例
在此示例中,我們將展示如何使用 Invoke-History 呼叫上次執行的命令。在不帶引數的情況下呼叫 Invoke-History。
Invoke-History Measure-Command { Get-EventLog "Windows PowerShell" }
輸出
Days : 0 Hours : 0 Minutes : 0 Seconds : 0 Milliseconds : 11 Ticks : 116083 TotalDays : 1.34355324074074E-07 TotalHours : 3.22452777777778E-06 TotalMinutes : 0.000193471666666667 TotalSeconds : 0.0116083 TotalMilliseconds : 11.6083
powershell_advanced_cmdlets.htm
廣告