Improved error handling in PowerShell scripts

Scripts now differentiate between HTML parsing errors and 400/500 status
codes.