Sample_RepairPackage.ps1 (737B)
1 <# 2 .SYNOPSIS 3 Example for 'Repair-WinGetPackage' cmdlet. 4 Repairs 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 # Repair a package by name 16 Repair-WinGetPackage -Name "PowerToys FileLocksmith Context Menu" 17 18 # Repair a package by version and package identifier. 19 Repair-WinGetPackage -Id "MSIX\Microsoft.PowerToys.FileLocksmithContextMenu_1.0.0.0_neutral__8wekyb3d8bbwe" 20 21 # Repair a package from a specific source 22 Repair-WinGetPackage -Id "MSIX\Microsoft.PowerToys.FileLocksmithContextMenu_1.0.0.0_neutral__8wekyb3d8bbwe" -Source winget