Execution Flow
Two independent removal paths exist because IBM DB2 client packages are sometimes MSI-based (registry-visible, removable via
msiexec /x) and sometimes installed via IBM's own Setup.exe bootstrapper with no MSI registry trace. The function tries the registry path first since it's more reliable, and only falls back to Setup.exe /silent /uninstall when nothing is found there.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters — auto-detects the installed DB2 driver. | |||
Return Value
Returns a single PSCustomObject with: Status (Uninstalled, NotFound, or Error), Message.
Examples
Example 1 — Remove whichever DB2 driver is installed
Uninstall-sqmDb2DriverExample 2 — Check the outcome
$r = Uninstall-sqmDb2Driver
if ($r.Status -eq 'Uninstalled') { Write-Host "DB2 driver removed" }