Windows 7 and Server 2008 R2 are the worst case scenarios and therefore are the focus of the below, howver, all of these steps work for Server 2012, 2012 R2 and Windows 8.1 - they take fewer steps because they have more of the prerequisites. I am very excited that the PowerShell team has just delivered the April Preview that allows version 5 to run on Windows 7 SP1 and Server 2008 R2 (PowerShell version 5). For this preview version there are a few foibles to getting it running on Windows 7. The PowerShell team hopes to sort these out, but in the mean time I have put together a quick config that steps you though everything with one command line.
Some additional information on the WMF 5 Production Preview is in this post: Poodles Through Burning Hoops: Plan for PowerShell 5 on Windows 7 and Server 2008. If you don't use Chocolatey (I feel sorry for you ) ), you can just steal my PowerShell code that does this piece of the puzzle. I have attempted to address this in the Chocolatey package I help maintain for the PowerShell package on. Update: WMF 5.1 now installs directly on top of WMF 3, however it can lose your PSModulePath customizations in the process.