This project is read-only.

scheduled task

Jan 20, 2015 at 4:49 PM
Edited Jan 20, 2015 at 4:49 PM
When the job is run from the scheduled task, , it uses Windows Shell and I get the following error:
Get-SPWebApplication : Microsoft SharePoint is not supported with version
4.0.30319.18444 of the Microsoft .Net Runtime.
At C:\temp\SPBestWarmUp.ps1:59 char:9

  • It runs fine with SharePoint 2010 Management Shell
    What can I do about this?
Developer
Nov 5, 2015 at 4:25 PM
It seems like you have installed the .net Framwork 4.x on a SharePoint 2010 enviroment. It is a know issue that the PowerShell cmdlets of sharePoint do not support the PowerShell greater version 2.0
You can change the Action in the Scheduler to:
Powershell.exe -version 2 -file <The path to the script>
Marked as answer by Samurai_ka on 11/5/2015 at 8:25 AM