PowerShell – Aides Mémoires


Version de Windows

# Version de Windows
$WindowsVersion = ([System.Environment]::OSVersion.Version).Major

Version du .Net Framework installée

# .Net Framework version
$DotNetRelease = (Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release
# 378389 = .NET Framework 4.5
# 378675 = .NET Framework 4.5.1 installed with Windows 8.1 or Windows Server 2012 R2
# 378758 = .NET Framework 4.5.1 installed on Windows 8, Windows 7 SP1, or Windows Vista SP2
# 379893 = .NET Framework 4.5.2
# 460798 = .NET Framework 4.7    On Windows 10 Creators Update only
# 460805 = .NET Framework 4.7    On all other OS versions
# 461308 = .NET Framework 4.7.1  On Windows 10 Fall Creators Update only
# 461310 = .NET Framework 4.7.1  On all other OS versions
# 461808 = .NET Framework 4.7.2  On Windows 10 April 2018 Update only
# 461814 = .NET Framework 4.7.2  On all other OS versions, including Windows 10 October 2018 Update