Closed artisticcheese closed 3 years ago
Same thing - tried multiple times with different packages. It's a pity that there is no reaction for such a long time
@jianyunt Can you confirm if the Programs provider currently supports uninstall? Code seems to suggest not, but I wanted to double check.
You are right. Programs supports get- only. See https://github.com/OneGet/oneget/blob/master/src/Microsoft.PackageManagement.CoreProviders/ProgramsProvider.cs
Is there a specific reason why this has only been implemented for the msi provider? Right now I'd have to uninstall a program like this:
$Pkg = Get-Package -Name "CRM.launcher"
$UninstallCommand = $Pkg.Meta.Attributes['UninstallString']
# "C:\Program Files (x86)\InstallShield Installation Information\{A4F81052-C7EF-454F-9436-9820C125C837}\setup.exe" -runfromtemp -l0x0409 -removeonly --silent
Start-Process -FilePath cmd.exe -ArgumentList '/c', $UninstallCommand -Wait
I've just checked the UninstallString
for packages retrieved via the Programs provider and not all of them feature a command that can be used for an unattended removal:
Get-Package -ProviderName Programs -ov pkgs | Sort Name,Version |
Select Name,@{l="UninstallString";e={$_.Meta.Attributes["UninstallString"]}}
I assume that's the reason why this has been on the backburner so far?
I don't see any technical reason, but I haven't looked into it yet so I could be wrong. At worst, if the program doesn't supply an uninstall command, we can write an error. This feature is currently scheduled for the v1.2.1 release, though there's no hard date.
If possible, please submit any requests for this feature in this thread. Thanks!
Hey @artisticcheese, have I missed something or why did you close the issue? :O
Nobody did anything for more then a year now on this issue so I thought no point in having it open.
Is there a specific reason why this has only been implemented for the msi provider? Right now I'd have to uninstall a program like this:
$Pkg = Get-Package -Name "CRM.launcher" $UninstallCommand = $Pkg.Meta.Attributes['UninstallString'] # "C:\Program Files (x86)\InstallShield Installation Information\{A4F81052-C7EF-454F-9436-9820C125C837}\setup.exe" -runfromtemp -l0x0409 -removeonly --silent Start-Process -FilePath cmd.exe -ArgumentList '/c', $UninstallCommand -Wait
I've just checked the
UninstallString
for packages retrieved via the Programs provider and not all of them feature a command that can be used for an unattended removal:Get-Package -ProviderName Programs -ov pkgs | Sort Name,Version | Select Name,@{l="UninstallString";e={$_.Meta.Attributes["UninstallString"]}}
I assume that's the reason why this has been on the backburner so far?
I use this:
Get-Package -Name "My Program Name" | Uninstall-Package -Force
Works most of the time
Not sure what I'm doing wrong but when I execute following cmdlet it does not show any errors but package is not being uninstalled either, despite the fact that there is no errors and verbose confirmation of uninstallation. Running it second time proves that package is still there.