Add-PSSnapin : Cannot load Windows PowerShell snap-in because of the following error: Could not load file or assembly or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
SolutionThis may happen if you work on your Cmdlets on 64 bit Windows, like I did. To solve that create a file called powershell.exe.config with the following content:
Place the file in the Powershell folder, close and reopen PS console and you are ready to go. The location of Powershell folder differs, depending if you want to use 32 or 64 bit version:
32 bit - %windir%\System32\WindowsPowerShell\V1.0 64 bit - %windir%\Syswow64\WindowsPowerShell\V1.0