스냅인이로드되지 않고 cmdlets가 잘못된 PowerShell 버전을 대상으로합니다. 어떻게 그 일이 일어 났습니까?
-
10-12-2019 - |
문제
Server-2008 SharePoint-2010 Dev Environment를 상속했습니다. SharePoint Snapin이로드되지 않습니다.경고 ...
Add-PSSnapin : Incorrect Windows PowerShell version 3.0. Windows PowerShell
version 2.0 is supported in the current console.
.
나는 모든 문서화 된 구제책을 따랐다 :
- WMF 3.0 및 KB2506146 제거
- "-version 2.0"매개 변수 를 사용하여 PowerShell.exe를 실행하십시오.
- PowerShell Config 에서 .NET 4.0에 대한 참조를 제거합니다.
스냅인은로드되지 않고 여전히 동일한 경고 "잘못된 Windows PowerShell 버전 ..."을 확인하여 버전을 확인합니다.좋아 보인다 ...
.PS C:\Users\Administrator> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 2 0 -1 -1
스냅인을 확인했습니다 ...
.PS C:\Users\Administrator> Get-PSSnapIn -Registered Name : Microsoft.SharePoint.PowerShell PSVersion : 3.0 Description : Register all administration Cmdlets for Microsoft SharePoint Server
psversion은 3.0입니까? 스냅인의 PSVersion은 다른 모든 시스템에서 1.0을 읽습니다.4.0 .NET 프레임 워크 때문에 3.0에서 실행되지 않습니다.어떻게이를 다시 바꿀 수 있습니까?PowerShell의 호환 가능한 버전을 목표로합니까? 도움을 줄 수있는 모든 도움을 주셔서 감사합니다.
해결책
The registry determines the level of PS compatibility, in my case the value was 3.0, it should be 1.0. I corrected this value by editing the following key:
HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.SharePoint.PowerShell\PowerShellVersion
The initial cause of the problem was the installation of the Windows Management Framework 3.0 which installs with it PowerShell. Even after uninstalling, the registry remained incorrect and I had to edit the registry with the information above.