I'm looking creating some health check scripts via Powershell for my environments. In my health check script I'm including the running status of my IIS Windows Services, and the Worker Process status. However, I can't figure out how to identify if my Appdomain has been unloaded. And if it has, what time was it unloaded.
FYI, the solution at How to check if AppDomain is unloaded? doesn't quite fit the bill. Looking into my own application log is another alternative, but I'm hoping there a way to check that by inspecting the worker process via Powershell or something.
My application is running on Windows Server 2012 R2 and IIS 8.5, and my health check scripts are using Powershell v4.0.