I try to list all applications, choose one of them and uninstall it, kind of like in control panel.
$package = get-package | Out-GridView -PassThru
Get-Package -Name $package.Name | Uninstall-Package
when I execute this and choose Google Chrome, it doesn't do much. this is probably a dumb question, not new to PowerShell but not veteran either
CodePudding user response:
The Uninstall-Package
cmdlet can't delete entries where "ProviderName" is "Programs"
Example:
get-package *chrome*
Name Version Source ProviderName
---- ------- ------ ------------
Google Chrome 105.0.5195.127 Programs
In general Programs with "ProviderName" property as "Programs" are ones that are installed via .exe .
If you want to uninstall packages with PackageManagement/PowerShellGet they need to be installed by PackageManagement/PowerShellGet.
Alternative would be to install Chocolatey Package Provider and it should be able to delete it