Sample_UninstallPackage.ps1 (622B)
1 <# 2 .SYNOPSIS 3 Example for 'Uninstall-WinGetPackage' cmdlet. 4 Uninstalls the specified application. 5 #> 6 7 # TODO: Replace parameter with actual module name from PSGallery once module is released. 8 Param ( 9 [Parameter(Mandatory)] 10 $ModulePath 11 ) 12 13 Import-Module -Name $ModulePath 14 15 # Uninstall a package by name 16 Uninstall-WinGetPackage -Name powertoys 17 18 # Uninstall a package by version and package identifier. 19 Uninstall-WinGetPackage -Id Microsoft.PowerToys -Version 0.15.2 20 21 # Uninstall a package from a specific source 22 Uninstall-WinGetPackage -Id Microsoft.PowerToys -Source winget