Assert-WinGetPackageManager.md (3273B)
1 --- 2 external help file: Microsoft.WinGet.Client.Cmdlets.dll-Help.xml 3 Module Name: Microsoft.WinGet.Client 4 ms.date: 08/01/2024 5 online version: 6 schema: 2.0.0 7 title: Assert-WinGetPackageManager 8 --- 9 10 # Assert-WinGetPackageManager 11 12 ## SYNOPSIS 13 Verifies that WinGet is installed properly. 14 15 ## SYNTAX 16 17 ### IntegrityVersionSet (Default) 18 19 ``` 20 Assert-WinGetPackageManager [-Version <String>] [<CommonParameters>] 21 ``` 22 23 ### IntegrityLatestSet 24 25 ``` 26 Assert-WinGetPackageManager [-Latest] [-IncludePrerelease] [<CommonParameters>] 27 ``` 28 29 ## DESCRIPTION 30 31 Verifies that WinGet is installed properly. 32 33 > [!NOTE] 34 > The cmdlet doesn't ensure that the latest version of WinGet is installed. It just verifies that 35 > the installed version of Winget is supported by installed version of the Microsoft.WinGet.Client 36 > module. 37 38 ## EXAMPLES 39 40 ### Example 1: Default usage 41 42 ```powershell 43 Assert-WinGetPackageManager 44 ``` 45 46 If the current version of WinGet is installed correctly, the command returns without error. 47 48 ### Example 2: Check if latest stable version is installed 49 50 ```powershell 51 Assert-WinGetPackageManager -Latest 52 ``` 53 54 If the latest version of WinGet is compatible with the installed Microsoft.WinGet.Client module, the 55 command returns without error. 56 57 ### Example 3: Check if latest preview version is installed 58 59 ```powershell 60 Assert-WinGetPackageManager -IncludePreRelease 61 ``` 62 63 If the prerelease version of WinGet is compatible with the installed Microsoft.WinGet.Client module, 64 the command returns without error. 65 66 ### Example 4: Check if specific version is installed 67 68 ```powershell 69 Assert-WinGetPackageManager -Version v1.8.1911 70 ``` 71 72 If the specified version of WinGet is compatible with the installed Microsoft.WinGet.Client module, 73 the command returns without error. 74 75 ## PARAMETERS 76 77 ### -IncludePreRelease 78 79 Include preview versions of WinGet. 80 81 ```yaml 82 Type: System.Management.Automation.SwitchParameter 83 Parameter Sets: IntegrityLatestSet 84 Aliases: 85 86 Required: False 87 Position: Named 88 Default value: None 89 Accept pipeline input: True (ByPropertyName) 90 Accept wildcard characters: False 91 ``` 92 93 ### -Latest 94 95 Verify that the latest version of WinGet is compatible with the installed version of the 96 Microsoft.WinGet.Client module. 97 98 ```yaml 99 Type: System.Management.Automation.SwitchParameter 100 Parameter Sets: IntegrityLatestSet 101 Aliases: 102 103 Required: False 104 Position: Named 105 Default value: None 106 Accept pipeline input: True (ByPropertyName) 107 Accept wildcard characters: False 108 ``` 109 110 ### -Version 111 112 Verify that a specific version of WinGet is installed correctly. 113 114 ```yaml 115 Type: System.String 116 Parameter Sets: IntegrityVersionSet 117 Aliases: 118 119 Required: False 120 Position: Named 121 Default value: None 122 Accept pipeline input: True (ByPropertyName) 123 Accept wildcard characters: False 124 ``` 125 126 ### CommonParameters 127 128 This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, 129 -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, 130 -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see 131 [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). 132 133 ## INPUTS 134 135 ### System.String 136 137 ### System.Management.Automation.SwitchParameter 138 139 ## OUTPUTS 140 141 ### System.Object 142 143 ## NOTES 144 145 ## RELATED LINKS 146 147 [Get-WinGetVersion](Get-WinGetVersion.md)