Windows 2012 R2 GA (General Availability) occurred in October 2013. Downloads of the Windows 2012 R2 RTM release were made available on MSDN before that time however there were some changes made between RTM and GA that have a significant impact on Desired State Configuration – it breaks on most code you will find.
The answer is to install some updates.
As an absolute bare minimum you should install the GA update – KB2883200 (Note that KB 2894029 and KB 2894179 are included in the KB2883200 download)
When you install Windows 2012 R2 check that KB2883200 has bee installed. If not download and install.
I’d also recommend that you install KB2884846 (you also get KB2898742) – the October 2013 update rollup.
There is also a March 2014 update rollup - KB2928680 – this important because it fixes the AD cmdlet issue
If you want to get the best out of Windows 2012 R2 make sure you install these updates. Matching updates are available for Windows 8.1 as well.