here an example
based on this person script https://www.reddit.com/r/SCCM/comments/cqif5a/visual_c_redist_detection_script/
##check VC Redistributable packages installed
Get-ChildItem HKLM:\SOFTWARE\WoW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | ForEach-Object {
$CurDisplayName = $_.GetValue("DisplayName")
if( $CurDisplayName -match "^Microsoft Visual C\+\+\D*(?<Year>(\d|-){4,9}).*Redistributable.*") {
#$Year = $Matches.Year
echo $Matches.0
}
}