A few weeks ago I got the SharePoint Server 2013 RTM from MSDN, and could not wait to try it.
The uninstalling of the previous client preview version, and the installation of RTM went very well. At the end of the configuration wizard, the Central Admin site was opened without any problem. Then I created the first web application and site collection. Perfect.
I was excited. In previous version, such as SharePoint 2010 or SharePoint 2007, the change from beta to RTM was always painful, always need some manual "tweak" to get it work. But this, obviously Microsoft paid special attention to that part.
However, soon I realized I was too optimistic. When I try to run "SharePoint 2013 Management Shell", I got the error message as below.
Add-PsSnapin : Cannot load Windows PowerShell Snap-In
Microsoft.SharePoint.PowerShell because of the following error: Unable to cast
object of type 'Microsoft.SharePoint.PowerShell.SPCmdletSnapIn' to type
At C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\SharePoint.ps1:3 char:1
+ Add-PsSnapin Microsoft.SharePoint.PowerShell
+ CategoryInfo : InvalidData: (Microsoft.SharePoint.PowerShell:St
ring) [Add-PSSnapin], PSSnapInException
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.Ad
Obviously the problem came from "Add-PsSnapin Microsoft.SharePoint.PowerShell", but, how? The server is Windows Server 2012, which already got PowerShell 3.0 installed.
It looks like something easy to fix, but it's not. I spent more than 4 hours, tried all the ways I know, but still no clue at all. In the end, I posted a help request here, and thanks for the reminding from Thomas Balkest, I gave it up.
In two hours, I rebuilt the whole virtual machine, and no problem any more after that.
Happy ending? Emm....sort of.