Execution Flow
Exit code
1605 ("this action is only valid for products that are currently installed") is treated as NotFound, not an error, the driver simply wasn't there. Exit code 3010 means the uninstall succeeded but a reboot is recommended. Without -DriverName, the registry is scanned for the pattern Microsoft ODBC Driver \d+ for SQL Server and the highest version number found is removed.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| -DriverName | String | Optional | Specific driver display name to match. Default: wildcard pattern Microsoft ODBC Driver * for SQL Server (matches the highest installed version). |
Return Value
Returns a single PSCustomObject with: Status (Uninstalled, NotFound, or Error), Message.
Examples
Example 1, Remove whichever ODBC driver version is installed
Uninstall-sqmOdbcDriverExample 2, Target a specific driver version explicitly
Uninstall-sqmOdbcDriver -DriverName "Microsoft ODBC Driver 17 for SQL Server"Example 3, Uninstall, then install the newer driver
Uninstall-sqmOdbcDriver
Install-sqmOdbcDriver