Friday, August 15, 2014

#22 : Get History of Command in Powershell

Get-History is the command which can be used to find the commands executed in the current session.

PS C:\Users\admin> Get-History

Id CommandLine
-- -----------
1 $arr=@()
2 $arr += "ABC"
3 $arr += "XYZ"
4 $arr += "PQR"
5 $arr[0]
6 $arr[1]
7 $arr[2]
8 $arr[3]
9 $arr.count
10 for ($x=0; $x -lt $arr.count; $x++) { echo ${arr}[$x] }
11 dir
12 Get-Counter
13 Get-EventLog
14 get-help

1 comment:

  1. https://connect.microsoft.com/PowerShell/feedback/details/534286/enable-command-history-between-sessions now between sessions. Ctrl+R

    ReplyDelete

#112: How to handle xml document in Powershell?

 In PowerShell, you can handle XML data using various cmdlets and methods provided by the .NET Framework. Here's a basic guide on how to...