Reworked PS version check to use the registry rather than running an instance of Powershell