By default PowerShell version 2 is available in 2008 R2 & Windows 7.
There is an document available for upgrading the PowerShell version on TechNet: https://technet.microsoft.com/en-us/library/hh847837.aspx.
There are so many reasons for upgrading the PowerShell version; we will discuss that later into this space. For Windows 2008 R2 almost the same steps can be taken for Windows 7 but Windows management framework is different for Win7. See the below link for supported OS.
http://www.microsoft.com/en-us/download/details.aspx?id=40855
WMF4 is now available, see the below link for that.
http://blogs.msdn.com/b/powershell/archive/2013/10/25/windows-management-framework-4-0-is-now-available.aspx
Here .NET framework is an important component for PowerShell version 4. Here is the link for getting to know for .NET framework version.
Below components are .NET 4.5.1 & WMF 4.
Now reboot that box.
Need to run powershell -version 4.0 for working with PS version 4. Check the PS version $psversiontable . You can see 4 is compatible with 3, 2 & 1
We now need to install the ISE for installing the version WMF 4.
If we have installed WMF 4, ISE will be installed in background.
Manual installation of ISE is not required.