Skip to content

Latest commit

 

History

History
184 lines (132 loc) · 4.94 KB

File metadata and controls

184 lines (132 loc) · 4.94 KB

external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml Module Name: Microsoft.WinGet.Client ms.date: 08/01/2024 online version: schema: 2.0.0 title: Repair-WinGetPackageManager

Repair-WinGetPackageManager

SYNOPSIS

Repairs the installation of the WinGet client on your computer.

SYNTAX

IntegrityVersionSet (Default)

Repair-WinGetPackageManager [-AllUsers] [-Force] [-Version <String>] [-IncludePreRelease] [<CommonParameters>]

IntegrityLatestSet

Repair-WinGetPackageManager [-AllUsers] [-Force] [-Latest] [-IncludePreRelease]
 [<CommonParameters>]

DESCRIPTION

This command repairs the installation of the WinGet client on your computer by installing the specified version or the latest version of the client. This command can also install the WinGet client if it is not already installed on your machine. It ensures that the client is installed in a working state.

EXAMPLES

Example 1: Repair the WinGet client

Repair-WinGetPackageManager

Ensures that the current installed version of WinGet is functioning properly.

Example 2: Force install the latest version

Repair-WinGetPackageManager -Latest -Force

This example shows how to repair they WinGet client by installing the latest version and ensuring it functions properly. The Force parameter shuts down the version that is currently running so that it can update the application files.

Example 3: Install a version with wildcards

Repair-WinGetPackageManager -Version "1.12.*" -Force

This example shows how to repair the WinGet client by installing a version that matches the specified version pattern. The Force parameter shuts down the version that is currently running so that it can update the application files.

PARAMETERS

-AllUsers

Use this parameter to repair the WinGet client for all user accounts on the computer. The command must run the command with administrator permissions.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Force

The Force parameter shuts down the version that is currently running so that it can update the application files.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-IncludePreRelease

Use this parameter to include prerelease versions of the WinGet client.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: IntegrityLatestSet
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Latest

Use this parameter to install the latest available version of the WinGet client.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: IntegrityLatestSet
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Version

Specifies the version of the WinGet client to install or repair. You can provide an exact version number or use wildcard characters (for example, "1.*.1*") to match and install the latest version that fits the pattern.

Type: System.String
Parameter Sets: IntegrityVersionSet
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Management.Automation.SwitchParameter

System.String

OUTPUTS

System.Int32

NOTES

This cmdlet makes GitHub API requests to query release information. Unauthenticated requests are subject to GitHub API rate limits, which can cause failures in CI/CD pipelines. If the GH_TOKEN or GITHUB_TOKEN environment variable is set, the cmdlet automatically uses it to authenticate requests, which significantly increases the rate limit.

GH_TOKEN takes precedence over GITHUB_TOKEN, matching GitHub CLI behavior. In GitHub Actions, you can make GITHUB_TOKEN available to the cmdlet by mapping it as an environment variable in your workflow step (e.g., env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}).

Use -Verbose to see which token source is being used.

RELATED LINKS

Get-WinGetVersion