Monitoring file creation using WMI and PowerEvents module
There are several ways we can create a file monitoring script using PowerShell. There is also a cmdlet in PowerShellPack called Start-FileSystemWatcher to monitor file /folder changes. However, none of these methods survive a exit at the console or wherever the script is running. This is because all these methods create a temporary event consumer. As Iβd mentioned in an earlier post, Trevorβs PowerEvents module makes it very easy to create permanent event consumers in PowerShell. In todayβs post, we shall look at how we can do that.