Below is small snippet that might help you in this case.
# Get installed versions of .NET Framework
$dotNetVersions = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name Version -ErrorAction SilentlyContinue | Where-Object { $_.Version -match '^4.' -or $_.Version -eq 'v2.0.50727' }
# Output information about each installed .NET Framework version
foreach ($version in $dotNetVersions) {
Write-Output ".NET Framework Version: $($version.Version)"
Write-Output "-----------------------------"
}
No comments:
Post a Comment