今天我的powershell更新到3.0版。这个版本是针对并使用.NET运行时4.0的。 Sharepoint 2010 cmdlet需要.NET 3.5,并且不能在4.0下运行。任何人都有一个想法如何让脚本工作?PowerShell 3.0 Sharepoint脚本不工作
我收到此错误: Remove-SPSite:Microsoft.Net运行时版本4.0.30319.296不支持Microsoft SharePoint。
今天我的powershell更新到3.0版。这个版本是针对并使用.NET运行时4.0的。 Sharepoint 2010 cmdlet需要.NET 3.5,并且不能在4.0下运行。任何人都有一个想法如何让脚本工作?PowerShell 3.0 Sharepoint脚本不工作
我收到此错误: Remove-SPSite:Microsoft.Net运行时版本4.0.30319.296不支持Microsoft SharePoint。
尝试推出PowerShell和:powershell.exe -version 2.0
powershell.exe -v 2
也应该可以正常工作
编辑:
最好是卸载造成这一问题的Windows Update KB2506143
检查这篇文章
Do not install the Windows Management Framework 3.0 (KB2506143) on SharePoint 2010 Servers
此主题是关于PowerGUI 。 C:\ Windows \ System32 \ WindowsPowerShell \ v1.0中没有配置文件powershell.exe.config。 – Ivan
对不起,我错了 –
不,我只是改进了一个已删除的答案 –
我今天也遇到了一些麻烦,但是这个解决了我的问题。
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 2.0 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
起初,我认为我有这使得它不工作,但你总是可以检查出来有$psversiontable
,确保CLRVERSION是2.0.50727.5466
类型尾随空间“的PowerShell -v 2” (不含引号)。在脚本 的顶部,然后第二次运行使用#评论它,如果脚本环聊 这会加载PowerShell版本2,并且您应该可以将其用于SharePoint。只需键入'退出'返回到PowerShell v3
伟大的作品! – Ivan
您也可以在V2中编辑/创建一个启动sharepoint命令模块的快捷方式:C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ powershell.exe -version 2.0 -NoExit“&'C:\ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 14 \ CONFIG \ POWERSHELL \ Registration \\ sharepoint.ps1'“ – kravits88
不适用于脚本$ w = get-spwebapplication,仍显示错误:PlatformNotSupported(4.0运行时) –