https://github.com/startautomating/powerhistory
PowerShell History Made More Powerful
https://github.com/startautomating/powerhistory
Last synced: 10 months ago
JSON representation
PowerShell History Made More Powerful
- Host: GitHub
- URL: https://github.com/startautomating/powerhistory
- Owner: StartAutomating
- License: mit
- Created: 2020-03-03T06:02:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T06:16:55.000Z (almost 6 years ago)
- Last Synced: 2025-03-24T08:46:10.778Z (10 months ago)
- Language: PowerShell
- Size: 15.6 KB
- Stars: 15
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PowerHistory adds additional features to PowerShell's history.
It adds useful information about any history item,
and allows you to add extra properties to any history item.
### Installing PowerHistory
You can clone the PowerHistory repository or Install PowerHistory from the PowerShell Gallery:
~~~
Install-Module PowerHistory -Scope CurrentUser
~~~
### Using PowerHistory
You can use PowerHistory just like Get-History:
~~~
Get-PowerHistory # Gets all history items
~~~
You can also do some more nifty tricks, like find items in history that use a module, command, or variable:
~~~
Get-PowerHistory -Module PowerHistory # Gets previous uses of commands from PowerHistory
Get-PowerHistory -Command Get-PowerHistory # Gets previous runs of Get-PowerHistory
Get-PowerHistory -Variable MyVariable # Gets previous uses of $MyVariable
~~~
### Tracing to the history
You can store command output in a PowerHistory entry with any given -Name (defaulting to Output), and add additional -Properties or -Tags
~~~
Get-Process | Trace-PowerHistory -Name ActiveProcesses -Property @{TimeStamp=[DateTime]::Now} -Tag Processes
~~~