Hi Barbarian,
Since your thread was archived, ill thank you for idea from this other thread, Sorry for spamming here.. I used your idea, but modified it.
Used in SCCM as script.
Function Dotnet-Check {
if (Test-Path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" ) {
$Version=(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" -Name Version).version
write-output $version}
elseif(test-path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0")
{Write-output "Version is 4.0"}
elseif(test-path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5")
{write-output "Version is 3.5"}
elseif(test-path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0")
{write-output "Version is 3.0"}
elseif(test-path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727")
{write-output "Version is 2.0"}
elseif(write-output "Version is Below 2.0!")
{write-output "Version is Below 2.0!"}
}
Dotnet-check