I have had to do this a couple times and always need to look up the command.
So I thought I would drop it here so I can search here first in the future.DISM /online /Set-Edition:ServerStandard /AcceptEula /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Technet Article for doing this on Server 2012: https://technet.microsoft.com/en-us/library/jj574204.aspx
Great job on the powershell, others usually do the command prompt.
Right click on Start open Powershell. I use that only because it is default. The command works in both. I have no preference for something like this command.