Last active
May 30, 2018 02:46
-
-
Save rriifftt/e5e4fc00e7a3603b7d22 to your computer and use it in GitHub Desktop.
powershell で .NET Framework のバージョンを確認 ref: https://qiita.com/satoshi_iwashita/items/0032969159af2b88d6e8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS C:\> $PSVersionTable | |
Name Value | |
---- ----- | |
PSVersion 4.0 | |
WSManStackVersion 3.0 | |
SerializationVersion 1.1.0.1 | |
CLRVersion 4.0.30319.34209 | |
BuildVersion 6.3.9600.17400 | |
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0} | |
PSRemotingProtocolVersion 2.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS C:\> get-item 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' | |
Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4 | |
Name Property | |
---- -------- | |
Full Version : 4.5.51650 | |
CBS : 1 | |
TargetVersion : 4.0.0 | |
Install : 1 | |
InstallPath : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ | |
Servicing : 0 | |
Release : 379893 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$release = (get-item 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full').GetValue("Release") | |
switch -Exact ($release) | |
{ | |
"378389" { Write-Host ".NET Framework 4.5" } | |
"378675" { Write-Host ".NET Framework 4.5.1 on Windows 8.1" } | |
"378758" { Write-Host ".NET Framework 4.5.1 on Windows vista/7/8" } | |
"379893" { Write-Host ".NET Framework 4.5.2" } | |
"393295" { Write-Host ".NET Framework 4.6 on Windows 10" } | |
"393297" { Write-Host ".NET Framework 4.6" } | |
"394254" { Write-Host ".NET Framework 4.6.1 on Windows 10" } | |
"394271" { Write-Host ".NET Framework 4.6.1" } | |
"394802" { Write-Host ".NET Framework 4.6.2 on Windows 10" } | |
"394806" { Write-Host ".NET Framework 4.6.2" } | |
"460798" { Write-Host ".NET Framework 4.7 on Windows 10" } | |
"460805" { Write-Host ".NET Framework 4.7" } | |
"461308" { Write-Host ".NET Framework 4.7.1 on Windows 10" } | |
"461310" { Write-Host ".NET Framework 4.7.1" } | |
"461808" { Write-Host ".NET Framework 4.7.2 on Windows 10" } | |
"461814" { Write-Host ".NET Framework 4.7.2" } | |
default { Write-Host "Unknown version" } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment