I'm in the process of migrating a lot of our scripts from Perl to Powershell, and I've run into a bit of a discrepency when polling for data in an IIS log file. I've checked the scripts multiple times, and I can't for the life of me figure out why this would be happening. Attached are the scripts in question. The original Perl script was written by a previous employee, and it unfortunately has zero comments.
Basically, in the Powershell monitor, every night from 7:15PM to 11:45PM, the Powershell script returns 0 for all statistics, but the Perl script keeps returning accurate data. See charts below: