Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jfromaniello/pswatch
Powershell cmdlet to monitor file changes in a directory tree.
https://github.com/jfromaniello/pswatch
Last synced: 6 days ago
JSON representation
Powershell cmdlet to monitor file changes in a directory tree.
- Host: GitHub
- URL: https://github.com/jfromaniello/pswatch
- Owner: jfromaniello
- Created: 2011-11-11T12:55:19.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2019-12-03T17:45:33.000Z (about 5 years ago)
- Last Synced: 2024-10-17T14:55:04.473Z (about 2 months ago)
- Homepage:
- Size: 94.7 KB
- Stars: 82
- Watchers: 8
- Forks: 13
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- jimsghstars - jfromaniello/pswatch - Powershell cmdlet to monitor file changes in a directory tree. (Others)
README
This powershell cmdlet continuously monitors a directory tree and write to the output the path of the file that has changed.
This allows you to create an script that for instance, run a suite of unit tests when an specific file has changed using powershell pipelining.
Installation
============Download the psm1 file in My documents\WindowsPowershell\Modules\pswatch or simply run this one line installation script:
iex ((new-object net.webclient).DownloadString("http://bit.ly/Install-PsWatch"))
Usage
=====A simple example will be:
Import-Module pswatch
watch "Myfolder\Other" | %{
Write-Host "$_.Path has changed!"
RunUnitTests.exe $_.Path
}You can filter by using powershell pipelining as follows:
watch | Get-Item | Where-Object { $_.Extension -eq ".js" } | %{
do the magic...
}Options
=======The wacth cmdlet has the following parameters:
* location: the directory to watch. Optional, default to current directory.
* includeSubdirectories: default to true.
* includeChanged: default to true.
* includeRenamed: default to true.
* includeCreated: default to true.
* includeDeleted: default to false.