Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell 3.0 Sharepoint scripts not working

Today my powershell updated to version 3.0. This version is build against and uses .NET runtime 4.0. The Sharepoint 2010 cmdlets require .NET 3.5 and don't work under 4.0. Anyone has an idea how to get scripts work?

I receive this error: Remove-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.296 of the Microsoft .Net Runtime.

like image 843
Ivan Avatar asked Dec 12 '12 11:12

Ivan


People also ask

Can not run script on PowerShell?

To fix this issue, we have to set the execution policy, so that the PowerShell script runs on the particular machine. Here is how: Open PowerShell Console by selecting “Run as Administrator” and get the execution Policy with the command: Get-ExecutionPolicy to get the current policy applied, such as “Restricted”.


1 Answers

try to launch powershell with : powershell.exe -version 2.0

like image 132
Loïc MICHEL Avatar answered Oct 04 '22 02:10

Loïc MICHEL