In SharePoint 2019, after uninstalling a SharePoint Solution using Uninstall-SPSolution and trying to add the same solution using Add-SPSolution PowerShell, I got this error Add-SPSolution: A solution with the same name or id already exists in the solution store.
Add-SPSolution : A solution with the same name
"webparts.wsp" or id "6ca32b40-73f1-4b39-8ed3-121ff6d46de5"
already exists in the solution store.
At line:1 char:1
+ Add-SPSolution -LiteralPath "c:\webparts.wsp"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share...dlet
AddSolution:SPCmdletAddSolution) [Add-SPSolution], ArgumentExc
eption
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCm
dletAddSolution
How to fix this error in SharePoint 2019?