Commands / Uninstall-sqmJdbcDriver
Driver Install/Uninstall

Uninstall-sqmJdbcDriver

Removes the Microsoft JDBC Driver for SQL Server by deleting its mssql-jdbc*.jar file(s) from the known install locations. Since JDBC ships as a plain JAR with no installer/MSI, deleting the file(s) is the uninstall. Optionally also strips JDBC entries from the machine-wide CLASSPATH.

Module: sqmSQLTool
Requires: Local Administrator
ShouldProcess: No
Output: PSCustomObject

Execution Flow

START foreach search root (Program Files, Program Files (x86), C:\jdbc) Get-ChildItem -Recurse -Filter mssql-jdbc*.jar Remove-Item each matching .jar file If the JDBC directory is now empty, remove it too Any .jar removed at all? Status = NotFound -RemoveClassPath? Strip mssql-jdbc from CLASSPATH Status = Uninstalled (N jar file(s) removed) Return PSCustomObject (Status, Message) DONE
Deletion is file-based, not registry-based — there's no MSI product to uninstall. -RemoveClassPath is off by default because the machine-wide CLASSPATH environment variable is sometimes managed centrally by other tooling; only enable it if this function is the sole owner of that entry.

Parameters

ParameterTypeRequiredDescription
-RemoveClassPathSwitchOptionalAlso strips any mssql-jdbc entry from the machine-wide CLASSPATH environment variable. Default: off.

Return Value

Returns a single PSCustomObject with: Status (Uninstalled or NotFound), Message (includes the list of removed JAR paths).

Examples

Example 1 — Remove the JDBC driver JAR(s)

Uninstall-sqmJdbcDriver

Example 2 — Also clean up the CLASSPATH entry

Uninstall-sqmJdbcDriver -RemoveClassPath