Last active
May 15, 2024 13:05
-
-
Save mbourgon/05c75cda141745e4244bbe876cba5c10 to your computer and use it in GitHub Desktop.
odbc driver file versions - find which version of all the drivers are installed.
This file contains 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
#the property "DriverODBCVer" is which version of *ODBC* it supports. We have to get the file info. | |
#https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/how-to-correctly-check-file-versions-with-powershell/ba-p/257642 | |
$odbc= get-odbcdriver|where {$_.name -match "sql server"} | |
$flat = foreach ($odbclist in $odbc){ | |
foreach($Property in ($odbclist.attribute)){ | |
$driverfilename = $property.driver -replace "%WINDIR%", "C:\windows\" | |
$driverversion = ((get-item $driverfilename).VersionInfo |select -expand Fileversion) | |
[pscustomobject]@{ | |
name = ($odbclist.name) | |
Property = $Property.driver | |
#Value = $Property.DriverODBCVer | |
Filever = $driverversion | |
}} | |
} | |
$flat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment