We have a need to run a PowerShell script which checks for a 404 status code from our web servers. This script works fine as a PowerShell standalone monitor for HTTP. We issue the HTTP to the web site, then check for the 404 on return. If we get a 404, we return a good status code.
Now we tried this same script for HTTPS but we get a Certificate error which is okay for the situation but the script fails because it sees the Certificate error stuff. The out of the box HTTPS monitor that comes with SAM does fine on these web sites that don't get the 404. There is an option for this monitor to ignore certificate errors.
So, what would be nice is to run my POWERSHELL script within the HTTPS monitor to use the feature that comes with that out of the box monitor. I put both of these monitors as components to one main monitor but during testing they seem to run in parallel. It would be nice to run the HTTPS first and then scan the page from the HTTPS in the subsequent script.
Is this doable in any way other than coding for the Certificate problem in my PowerShell script?