Skip to content

Instantly share code, notes, and snippets.

View gitfvb's full-sized avatar
👋

Florian von Bracht gitfvb

👋
View GitHub Profile
# references:
# https://community.spiceworks.com/topic/380201-using-powershell-to-check-for-new-files-in-a-directory
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/register-objectevent
# https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher
# you can change $p to whatever path you want, you can also add file filters, and add more events
# i am monitoring a folder for all create/delete events and color coding output
$p = $pwd.path
$w = New-Object System.IO.FileSystemWatcher $p
$w.IncludeSubdirectories = $true