Repair-WinGetPackage.md (8068B)
1 --- 2 external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml 3 Module Name: Microsoft.WinGet.Client 4 ms.date: 08/26/2024 5 online version: 6 schema: 2.0.0 7 --- 8 9 # Repair-WinGetPackage 10 11 ## SYNOPSIS 12 Repairs a WinGet Package. 13 14 ## SYNTAX 15 16 ### FoundSet (Default) 17 ``` 18 Repair-WinGetPackage [-Mode <PSPackageRepairMode>] [-Log <String>] [-Version <String>] [-Id <String>] 19 [-Name <String>] [-Moniker <String>] [-Source <String>] [[-Query] <String[]>] 20 [-MatchOption <PSPackageFieldMatchOption>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] 21 [<CommonParameters>] 22 ``` 23 24 ### GivenSet 25 ``` 26 Repair-WinGetPackage [-Mode <PSPackageRepairMode>] [-Log <String>] [[-PSCatalogPackage] <PSCatalogPackage>] 27 [-Version <String>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>] 28 ``` 29 30 ## DESCRIPTION 31 This command repairs a WinGet package from your computer, provided the package includes repair support. 32 The command includes parameters to specify values used to search for installed packages. By default, 33 all string-based searches are case-insensitive substring searches. Wildcards are not supported. 34 You can change the search behavior using the **MatchOption** parameter. 35 36 > **Note: Not all packages support repair.** 37 38 ## EXAMPLES 39 40 ### Example 1: Repair a package using a query 41 ```powershell 42 Repair-WinGetPackage -Query "Microsoft.GDK.2406" 43 ``` 44 This example shows how to repair a package using a query. The **Query** parameter is positional, so you 45 don't need to include the parameter name before the query string. 46 47 ### Example 3 : Repair a package by Id 48 ```powershell 49 Repair-WinGetPackage -Id "Microsoft.GDK.2406" 50 ``` 51 This example shows how to repair a package by specifying the package identifier. 52 53 If the package identifier is available from more than one source, you must provide additional search 54 criteria to select a specific instance of the package. 55 56 ### Example 3: Repair a package using by Name 57 ```powershell 58 Repair-WinGetPackage -Name "Microsoft Game Development Kit - 240602 (June 2024 Update 2)" 59 ``` 60 This example shows how to repair a package using the package name. 61 62 > **Note: Please note that the examples mentioned above are mainly reference examples for the repair cmdlet and may not be operational as is, since many installers don't support repair as a standard functionality. For the Microsoft.GDK.2406 example, the assumption is that Microsoft.GDK.2406 supports repair capability and the author of the installer has provided the necessary repair context/switches in the Package Manifest in the Package Source referenced by the WinGet Client.** 63 64 ## PARAMETERS 65 66 ### -Id 67 68 Specify the package identifier to search for. By default, the command does a case-insensitive 69 substring match. 70 71 ```yaml 72 Type: System.String 73 Parameter Sets: FoundSet 74 Aliases: 75 76 Required: False 77 Position: Named 78 Default value: None 79 Accept pipeline input: True (ByPropertyName) 80 Accept wildcard characters: False 81 ``` 82 83 ### -Log 84 85 Specify the location for the installer repair log. The value can be a fully-qualified or relative path and must include the file name. For example: `$env:TEMP\package.log`. 86 87 > **Note: Not all installers support this option.** 88 89 ```yaml 90 Type: System.String 91 Parameter Sets: (All) 92 Aliases: 93 94 Required: False 95 Position: Named 96 Default value: None 97 Accept pipeline input: False 98 Accept wildcard characters: False 99 ``` 100 101 ### -MatchOption 102 103 Specify the match option for a WinGet package query. This parameter accepts the following values: 104 105 ```yaml 106 Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption 107 Parameter Sets: FoundSet 108 Aliases: 109 Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive 110 111 Required: False 112 Position: Named 113 Default value: None 114 Accept pipeline input: True (ByPropertyName) 115 Accept wildcard characters: False 116 ``` 117 118 ### -Mode 119 120 Specify the output mode for the installer. The parameter accepts the following values: 121 122 ```yaml 123 Type: Microsoft.WinGet.Client.PSObjects.PSPackageRepairMode 124 Parameter Sets: (All) 125 Aliases: 126 Accepted values: Default, Silent, Interactive 127 128 Required: False 129 Position: Named 130 Default value: None 131 Accept pipeline input: True (ByPropertyName) 132 Accept wildcard characters: False 133 ``` 134 135 ### -Moniker 136 137 Specify the moniker of the WinGet package to repair. For example, the moniker for the 138 Microsoft.PowerShell package is `pwsh`. 139 140 ```yaml 141 Type: System.String 142 Parameter Sets: FoundSet 143 Aliases: 144 145 Required: False 146 Position: Named 147 Default value: None 148 Accept pipeline input: True (ByPropertyName) 149 Accept wildcard characters: False 150 ``` 151 152 ### -Name 153 154 Specify the name of the WinGet package name. The name contains space, you must enclose the name in 155 quotes. 156 157 ```yaml 158 Type: System.String 159 Parameter Sets: FoundSet 160 Aliases: 161 162 Required: False 163 Position: Named 164 Default value: None 165 Accept pipeline input: True (ByPropertyName) 166 Accept wildcard characters: False 167 ``` 168 169 ### -PSCatalogPackage 170 Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the 171 `Find-WinGetPackage` or `Get-WingetPackage` commands. 172 173 174 ```yaml 175 Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage 176 Parameter Sets: GivenSet 177 Aliases: InputObject 178 179 Required: False 180 Position: 0 181 Default value: None 182 Accept pipeline input: True (ByPropertyName, ByValue) 183 Accept wildcard characters: False 184 ``` 185 186 ### -Query 187 188 Specify one or more strings to search for. By default, the command searches all configured sources. 189 Wildcards are not supported. The command compares the value provided to the following package 190 manifest properties: 191 192 - `PackageIdentifier` 193 - `PackageName` 194 - `Moniker` 195 - `Tags` 196 197 The command does a case-insensitive substring comparison of these properties. 198 199 ```yaml 200 Type: System.String[] 201 Parameter Sets: FoundSet 202 Aliases: 203 204 Required: False 205 Position: 0 206 Default value: None 207 Accept pipeline input: True (ByPropertyName) 208 Accept wildcard characters: False 209 ``` 210 211 ### -Source 212 213 Specify the name of a configured WinGet source. 214 215 ```yaml 216 Type: System.String 217 Parameter Sets: FoundSet 218 Aliases: 219 220 Required: False 221 Position: Named 222 Default value: None 223 Accept pipeline input: True (ByPropertyName) 224 Accept wildcard characters: False 225 ``` 226 227 ### -Version 228 229 Specify the version of the package to be repaired. 230 231 ```yaml 232 Type: System.String 233 Parameter Sets: (All) 234 Aliases: 235 236 Required: False 237 Position: Named 238 Default value: None 239 Accept pipeline input: True (ByPropertyName) 240 Accept wildcard characters: False 241 ``` 242 243 ### -Confirm 244 245 Prompts you for confirmation before running the cmdlet. 246 247 ```yaml 248 Type: System.Management.Automation.SwitchParameter 249 Parameter Sets: (All) 250 Aliases: cf 251 252 Required: False 253 Position: Named 254 Default value: None 255 Accept pipeline input: False 256 Accept wildcard characters: False 257 ``` 258 259 260 ### -WhatIf 261 Shows what would happen if the cmdlet runs. 262 The cmdlet is not run. 263 264 ```yaml 265 Type: System.Management.Automation.SwitchParameter 266 Parameter Sets: (All) 267 Aliases: wi 268 269 Required: False 270 Position: Named 271 Default value: None 272 Accept pipeline input: False 273 Accept wildcard characters: False 274 ``` 275 276 ### CommonParameters 277 This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 278 279 ## INPUTS 280 281 ### Microsoft.WinGet.Client.PSObjects.PSPackageRepairMode 282 283 ### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage 284 285 ### System.String 286 287 ### System.String[] 288 289 ### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption 290 291 ## OUTPUTS 292 293 ### Microsoft.WinGet.Client.Engine.PSObjects.PSRepairResult 294 295 ## NOTES 296 297 ## RELATED LINKS 298 299 [Find-WinGetPackage](Find-WinGetPackage.md) 300 301 [Install-WinGetPackage](Install-WinGetPackage.md) 302 303 [Uninstall-WinGetPackage](Uninstall-WinGetPackage.md)