Both Windows 8 and Windows Server 2012 have windows powershell 3.0
Windows powershell 3.0 uses. netframework 4.0.
An error occurred while executing the. netframework 2.0 script.
For example, Sharepoint 2010
You cannot access the local server farm. The cmdlet with featuredependencyid is not registered. PS c: \ Users \ luozhuang> remove-spwebapplication-identity http: // win-kfmi99jvfn9/-confirmremove-spwebapplication: Microsoft. NET runtime version 4.0.30319.18010 does not support Microsoft SharePoint. Location row: 1 character: 1 + remove-spwebapplication-identity http: // win-kfmi99jvfn9/-confirm + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Categoryinfo: invaliddata: (Microsoft. share... pwebapplication: spcmdletremovespwebapplication) [remove-spwebapplication], platformnotsuppo rtedexception + fullyqualifiederrorid: Microsoft. sharepoint. powershell. spcmdletremovesp webapplicationps c: \ Users \ luozhuang>
What should I do? Check it online and say yes
Registry key: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ powershell \ 1 \ powershellengine
Modify the runtimeversion Of the. NET Framework you want to use.
The result does not work.
Solution:
Server Manager-> Add roles and features. go to Server Management> Add roles and functions. For win2012, go to Control Panel> uninstall or change program> enable or disable windows.
Choose to install the following two features
. NET Framework 3.5
Windows powershell 2.0
After the installation is complete, you need to use the following steps to run. netframework 2.0:
PowerShell.exe -Version 2
For example, modify the shortcut of SharePoint 2012 as follows:
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 ' "