Today I encountered an error with a TimedPowerShell discovery. The Invoke-WebRequest command was the cause as I found out in the Event Log.
The targeted server was running Windows Server 2012 with PowerShell version 3. Apparently there is know bug: https://connect.microsoft.com/PowerShell/feedback/details/734056/invoke-webrequest-ie-error
The workaround is to open Internet Explorer with the account executing the command. Since the SCOM agent uses “Local System”, the solution is to run it with PsExec: http://marckean.wordpress.com/2010/12/17/run-internet-explorer-as-the-local-system-account/
After starting Internet Explorer once with “Local system” the discovery finished the script with out errors.