I know that for older versions of .NET, you can determine if a given version is installed by following
https://support.microsoft.com/en-us/kb/318785
You can check if dotnet.exe is available:
where dotnet
You can then check the version:
dotnet --version
UPDATE: There is now a better way of doing this, which is well explained in many other answers:
dotnet --info