You should be using $wmiget(Win32_OperatingSystem).Caption
This returns Windows 7 Ultimate for me, it should return the same for you with "8" instead. Windows 8 has NOT changed this function: http://msdn.microsoft.com/en-us/library/windows/desktop/aa394239(v=vs.85).aspx