winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Export-WinGetPackage.md (10190B)


      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: Export-WinGetPackage
      8 ---
      9 
     10 # Export-WinGetPackage
     11 
     12 ## SYNOPSIS
     13 Downloads a WinGet package and its dependencies.
     14 
     15 ## SYNTAX
     16 
     17 ### FoundSet (Default)
     18 
     19 ```
     20 Export-WinGetPackage [-DownloadDirectory <String>] [-AllowHashMismatch]
     21  [-Architecture <PSProcessorArchitecture>] [-InstallerType <PSPackageInstallerType>] [-Locale <String>]
     22  [-Scope <PSPackageInstallScope>] [-SkipDependencies] [-Version <String>] [-Id <String>] [-Name <String>]
     23  [-Moniker <String>] [-Source <String>] [[-Query] <String[]>] [-MatchOption <PSPackageFieldMatchOption>]
     24  [-WhatIf] [-Confirm] [<CommonParameters>]
     25 ```
     26 
     27 ### GivenSet
     28 
     29 ```
     30 Export-WinGetPackage [-DownloadDirectory <String>] [-AllowHashMismatch]
     31  [-Architecture <PSProcessorArchitecture>] [-InstallerType <PSPackageInstallerType>] [-Locale <String>]
     32  [-Scope <PSPackageInstallScope>] [-SkipDependencies] [[-PSCatalogPackage] <PSCatalogPackage>]
     33  [-Version <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
     34 ```
     35 
     36 ## DESCRIPTION
     37 
     38 This command downloads a WinGet package from a configured source. The command downloads the package,
     39 its manifest, as well as its dependencies and their manifests. By default, the packages are
     40 downloaded to your `Downloads` folder. You can use the **DownloadDirectory** parameter to change
     41 the location.
     42 
     43 For Microsoft Azure users, if the package is coming from the Microsoft Store, the command also
     44 downloads the package license file. The user needs to have one of the following Roles in Azure:
     45 
     46 - Global Administrator
     47 - User Administrator
     48 - License Administrator
     49 
     50 ## EXAMPLES
     51 
     52 ### Example 1: Download Microsoft.PowerShell to the default location
     53 
     54 ```powershell
     55 Export-WinGetPackage -Id Microsoft.PowerShell
     56 ```
     57 
     58 ```Output
     59 Id                   Name       Source Status ExtendedErrorCode CorrelationData
     60 --                   ----       ------ ------ ----------------- ---------------
     61 Microsoft.PowerShell PowerShell winget Ok
     62 ```
     63 
     64 ```powershell
     65 dir ~\Downloads\Microsoft.PowerShell_7.4.4.0
     66 ```
     67 
     68 ```Output
     69     Directory: C:\Users\user1\Downloads\Microsoft.PowerShell_7.4.4.0
     70 
     71 Mode                 LastWriteTime         Length Name
     72 ----                 -------------         ------ ----
     73 -a---            8/7/2024  2:05 PM      108404736 PowerShell_7.4.4.0_Machine_X64_wix_en-US.msi
     74 -a---            8/7/2024  2:05 PM           3838 PowerShell_7.4.4.0_Machine_X64_wix_en-US.yaml
     75 ```
     76 
     77 This example shows how to download a package for the current machine and scope. For this example,
     78 the command downloads the latest version of the installer package and manifest for
     79 Microsoft.PowerShell. The command puts the files a new folder in your `Downloads` location. The
     80 folder name is created by concatenating the package identifier and version number.
     81 
     82 ## PARAMETERS
     83 
     84 ### -AllowHashMismatch
     85 
     86 Allows you to download package even when the SHA256 hash for an installer or a dependency does not
     87 match the SHA256 hash in the WinGet package manifest.
     88 
     89 ```yaml
     90 Type: System.Management.Automation.SwitchParameter
     91 Parameter Sets: (All)
     92 Aliases:
     93 
     94 Required: False
     95 Position: Named
     96 Default value: None
     97 Accept pipeline input: True (ByPropertyName)
     98 Accept wildcard characters: False
     99 ```
    100 
    101 ### -Architecture
    102 
    103 Specify the processor architecture for the WinGet package installer.
    104 
    105 ```yaml
    106 Type: Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture
    107 Parameter Sets: (All)
    108 Aliases:
    109 Accepted values: Default, X86, Arm, X64, Arm64
    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 ### -DownloadDirectory
    119 
    120 Specify the location where you want to store the downloaded files.
    121 
    122 ```yaml
    123 Type: System.String
    124 Parameter Sets: (All)
    125 Aliases:
    126 
    127 Required: False
    128 Position: Named
    129 Default value: None
    130 Accept pipeline input: True (ByPropertyName)
    131 Accept wildcard characters: False
    132 ```
    133 
    134 ### -Id
    135 
    136 Specify the WinGet package identifier
    137 
    138 ```yaml
    139 Type: System.String
    140 Parameter Sets: FoundSet
    141 Aliases:
    142 
    143 Required: False
    144 Position: Named
    145 Default value: None
    146 Accept pipeline input: True (ByPropertyName)
    147 Accept wildcard characters: False
    148 ```
    149 
    150 ### -InstallerType
    151 
    152 Specify the type of installer package to download. This parameter accepts the following values:
    153 
    154 - `Default`
    155 - `Inno`
    156 - `Wix`
    157 - `Msi`
    158 - `Nullsoft`
    159 - `Zip`
    160 - `Msix`
    161 - `Exe`
    162 - `Burn`
    163 - `MSStore`
    164 - `Portable`
    165 
    166 > [!NOTE]
    167 > The installer type must be available in the WinGet package manifest.
    168 
    169 ```yaml
    170 Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType
    171 Parameter Sets: (All)
    172 Aliases:
    173 Accepted values: Default, Inno, Wix, Msi, Nullsoft, Zip, Msix, Exe, Burn, MSStore, Portable
    174 
    175 Required: False
    176 Position: Named
    177 Default value: None
    178 Accept pipeline input: True (ByPropertyName)
    179 Accept wildcard characters: False
    180 ```
    181 
    182 ### -Locale
    183 
    184 Specify the locale of the installer package. The locale must provided in the BCP 47 format, such as
    185 `en-US`. For more information, see
    186 [Standard locale names](/globalization/locale/standard-locale-names).
    187 
    188 > [!NOTE]
    189 > The locale must be available in the WinGet package manifest.
    190 
    191 ```yaml
    192 Type: System.String
    193 Parameter Sets: (All)
    194 Aliases:
    195 
    196 Required: False
    197 Position: Named
    198 Default value: None
    199 Accept pipeline input: True (ByPropertyName)
    200 Accept wildcard characters: False
    201 ```
    202 
    203 ### -MatchOption
    204 
    205 Specify the match option for a WinGet package query. This parameter accepts the following values:
    206 
    207 - `Equals`
    208 - `EqualsCaseInsensitive`
    209 - `StartsWithCaseInsensitive`
    210 - `ContainsCaseInsensitive`
    211 
    212 ```yaml
    213 Type: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption
    214 Parameter Sets: FoundSet
    215 Aliases:
    216 Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive
    217 
    218 Required: False
    219 Position: Named
    220 Default value: None
    221 Accept pipeline input: True (ByPropertyName)
    222 Accept wildcard characters: False
    223 ```
    224 
    225 ### -Moniker
    226 
    227 Specify the moniker of the WinGet package to download. For example, the moniker for the
    228 Microsoft.PowerShell package is `pwsh`.
    229 
    230 ```yaml
    231 Type: System.String
    232 Parameter Sets: FoundSet
    233 Aliases:
    234 
    235 Required: False
    236 Position: Named
    237 Default value: None
    238 Accept pipeline input: True (ByPropertyName)
    239 Accept wildcard characters: False
    240 ```
    241 
    242 ### -Name
    243 
    244 Specify the name of the WinGet package.
    245 
    246 ```yaml
    247 Type: System.String
    248 Parameter Sets: FoundSet
    249 Aliases:
    250 
    251 Required: False
    252 Position: Named
    253 Default value: None
    254 Accept pipeline input: True (ByPropertyName)
    255 Accept wildcard characters: False
    256 ```
    257 
    258 ### -PSCatalogPackage
    259 
    260 Provide **PSCatalogPackage** object. You can get a **PSCatalogPackage** object by using the
    261 `Find-WinGetPackage` command.
    262 
    263 ```yaml
    264 Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage
    265 Parameter Sets: GivenSet
    266 Aliases: InputObject
    267 
    268 Required: False
    269 Position: 0
    270 Default value: None
    271 Accept pipeline input: True (ByPropertyName, ByValue)
    272 Accept wildcard characters: False
    273 ```
    274 
    275 ### -Query
    276 
    277 One or more strings to search for in the WinGet package. The command searches for matching strings
    278 in the following properties of the package manifest:
    279 
    280 - `PackageName`
    281 - `PackageIdentifier`
    282 - `Moniker`
    283 - `Tags`
    284 
    285 ```yaml
    286 Type: System.String[]
    287 Parameter Sets: FoundSet
    288 Aliases:
    289 
    290 Required: False
    291 Position: 0
    292 Default value: None
    293 Accept pipeline input: True (ByPropertyName)
    294 Accept wildcard characters: False
    295 ```
    296 
    297 ### -Scope
    298 
    299 Specify WinGet package installer scope. The parameter accepts the following values:
    300 
    301 - `Any`
    302 - `User`
    303 - `System`
    304 - `UserOrUnknown`
    305 - `SystemOrUnknown`
    306 
    307 > [!NOTE]
    308 > The installer scope must be available in the WinGet package manifest.
    309 
    310 ```yaml
    311 Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope
    312 Parameter Sets: (All)
    313 Aliases:
    314 Accepted values: Any, User, System, UserOrUnknown, SystemOrUnknown
    315 
    316 Required: False
    317 Position: Named
    318 Default value: None
    319 Accept pipeline input: True (ByPropertyName)
    320 Accept wildcard characters: False
    321 ```
    322 
    323 ### -SkipDependencies
    324 
    325 Specifies that the command shouldn't download the WinGet package dependencies.
    326 
    327 ```yaml
    328 Type: System.Management.Automation.SwitchParameter
    329 Parameter Sets: (All)
    330 Aliases:
    331 
    332 Required: False
    333 Position: Named
    334 Default value: None
    335 Accept pipeline input: True (ByPropertyName)
    336 Accept wildcard characters: False
    337 ```
    338 
    339 ### -Source
    340 
    341 Specifies WinGet source.
    342 
    343 ```yaml
    344 Type: System.String
    345 Parameter Sets: FoundSet
    346 Aliases:
    347 
    348 Required: False
    349 Position: Named
    350 Default value: None
    351 Accept pipeline input: True (ByPropertyName)
    352 Accept wildcard characters: False
    353 ```
    354 
    355 ### -Version
    356 
    357 Specifies the version of the WinGet package to download.
    358 
    359 ```yaml
    360 Type: System.String
    361 Parameter Sets: (All)
    362 Aliases:
    363 
    364 Required: False
    365 Position: Named
    366 Default value: None
    367 Accept pipeline input: True (ByPropertyName)
    368 Accept wildcard characters: False
    369 ```
    370 
    371 ### -Confirm
    372 
    373 Prompts you for confirmation before running the cmdlet.
    374 
    375 ```yaml
    376 Type: System.Management.Automation.SwitchParameter
    377 Parameter Sets: (All)
    378 Aliases: cf
    379 
    380 Required: False
    381 Position: Named
    382 Default value: None
    383 Accept pipeline input: False
    384 Accept wildcard characters: False
    385 ```
    386 
    387 ### -WhatIf
    388 
    389 Shows what would happen if the cmdlet runs. The cmdlet isn't run.
    390 
    391 ```yaml
    392 Type: System.Management.Automation.SwitchParameter
    393 Parameter Sets: (All)
    394 Aliases: wi
    395 
    396 Required: False
    397 Position: Named
    398 Default value: None
    399 Accept pipeline input: False
    400 Accept wildcard characters: False
    401 ```
    402 
    403 ### CommonParameters
    404 
    405 This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
    406 -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable,
    407 -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
    408 [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
    409 
    410 ## INPUTS
    411 
    412 ### System.String
    413 
    414 ### System.Management.Automation.SwitchParameter
    415 
    416 ### Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture
    417 
    418 ### Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType
    419 
    420 ### Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope
    421 
    422 ### Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage
    423 
    424 ### System.String[]
    425 
    426 ### Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption
    427 
    428 ## OUTPUTS
    429 
    430 ### Microsoft.WinGet.Client.Engine.PSObjects.PSDownloadResult
    431 
    432 ## NOTES
    433 
    434 ## RELATED LINKS
    435 
    436 [Find-WinGetPackage](Find-WinGetPackage.md)