Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninstall-Package for "Programs" provider is not working #273

Closed
artisticcheese opened this issue Mar 15, 2017 · 8 comments
Closed

Uninstall-Package for "Programs" provider is not working #273

artisticcheese opened this issue Mar 15, 2017 · 8 comments

Comments

@artisticcheese
Copy link

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.

PS C:\WINDOWS\system32> get-package -ProviderName Programs | where SwidTagText -match "lenovo" | select -First 1 | uninstall-package -Verbose
VERBOSE: Performing the operation "Uninstall Package." on target "Package 'Lenovo Bluetooth Lock' with version '2.0.1.0407'.".

PS C:\WINDOWS\system32> get-package -ProviderName Programs | where SwidTagText -match "lenovo" | select -First 1 | uninstall-package -Verbose
VERBOSE: Performing the operation "Uninstall Package." on target "Package 'Lenovo Bluetooth Lock' with version '2.0.1.0407'.".
@mkarpuk
Copy link

mkarpuk commented Aug 18, 2017

Same thing - tried multiple times with different packages. It's a pity that there is no reaction for such a long time

@brywang-msft
Copy link
Contributor

@jianyunt Can you confirm if the Programs provider currently supports uninstall? Code seems to suggest not, but I wanted to double check.

@jianyunt
Copy link
Contributor

@megamorf
Copy link

megamorf commented Sep 13, 2017

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?

@brywang-msft
Copy link
Contributor

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!

@megamorf
Copy link

Hey @artisticcheese, have I missed something or why did you close the issue? :O

@artisticcheese
Copy link
Author

Nobody did anything for more then a year now on this issue so I thought no point in having it open.

@nturnerlivanova
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants