Scripting Blog

A place to learn about PowerShell and share stories of automation

How Can I Automatically Run a Script Any Time a File is Added to a Folder?

Hey, Scripting Guy! Is it possible to have a script automatically run any time a file is added to a specific folder?-- MB Hey, WM. Yes, this is possible, thanks to the magic of WMI events, which allow you to write a script to monitor for something of interest (like a file being added to a folder) and then take some action any time an event ...

How Can I Be Notified Any Time a Service Goes Down?

Hey, Scripting Guy! How can I be notified any time a service goes down?-- RN Hey, RN. As usual, there are a couple different ways you can do this, but perhaps the simplest approach is to create a script that monitors WMI events. We don’t have time to do a detailed explanation of WMI events in this column, but the basic idea is that you can ...