admin 管理员组文章数量: 1184232
Windows 8和 Windows Server 2012都带有 Windows PowerShell 3.0
Windows PowerShell 3.0使用的是 .netframework 4.0
执行 .netframework 2.0脚本会出错
比如 sharepoint 2010
不能访问本地服务器场。没有注册带有FeatureDependencyId 的 Cmdlet。
PS C:\Users\luozhuang> Remove-SPWebApplication -identity
-Confirm
Remove-SPWebApplication : Microsoft .Net Runtime 的版本 4.0.30319.18010 不支持
Microsoft SharePoint。
所在位置 行:1 字符: 1
+ Remove-SPWebApplication -identity -Confirm
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share...PWebApplication:
SPCmdletRemoveSPWebApplication) [Remove-SPWebApplication],PlatformNotSuppo
rtedException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSP
WebApplication
PS C:\Users\luozhuang>怎么办,上网查查,说是
注册表项:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine
修改RuntimeVersion为你想使用的.NET Framework 版本即可。
结果行不通
解决方法:
Server Manager-> Add Roles and Features. 就是进服务器管理-〉添加角色和功能,对应win2012,如果是win8就进控制面板-〉卸载或更改程序-〉打开或关闭windows 功能
选择安装下面两个功能
.NET Framework 3.5
Windows PowerShell 2.0
安装好了以后,对于需要运行 .netframework 2.0 脚步需要这样使用:
PowerShell.exe -Version 2比如修改sharepoint 2012 那个快捷方式为:
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -Version 2 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "版权声明:本文标题:安装PowerShell 3.0,为什么还是用着老版的.NET Framework? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1773626176a3564098.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论