src/PowerShell/Help/Microsoft.WinGet.Client/Export-WinGetPackage.md
Downloads a WinGet package and its dependencies.
Export-WinGetPackage [-DownloadDirectory <String>] [-AllowHashMismatch]
[-Architecture <PSProcessorArchitecture>] [-InstallerType <PSPackageInstallerType>] [-Locale <String>]
[-Scope <PSPackageInstallScope>] [-SkipDependencies] [-Version <String>] [-Id <String>] [-Name <String>]
[-Moniker <String>] [-Source <String>] [[-Query] <String[]>] [-MatchOption <PSPackageFieldMatchOption>]
[-WhatIf] [-Confirm] [<CommonParameters>]
Export-WinGetPackage [-DownloadDirectory <String>] [-AllowHashMismatch]
[-Architecture <PSProcessorArchitecture>] [-InstallerType <PSPackageInstallerType>] [-Locale <String>]
[-Scope <PSPackageInstallScope>] [-SkipDependencies] [[-PSCatalogPackage] <PSCatalogPackage>]
[-Version <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
This command downloads a WinGet package from a configured source. The command downloads the package,
its manifest, as well as its dependencies and their manifests. By default, the packages are
downloaded to your Downloads folder. You can use the DownloadDirectory parameter to change
the location.
For Microsoft Azure users, if the package is coming from the Microsoft Store, the command also downloads the package license file. The user needs to have one of the following Roles in Azure:
Export-WinGetPackage -Id Microsoft.PowerShell
Id Name Source Status ExtendedErrorCode CorrelationData
-- ---- ------ ------ ----------------- ---------------
Microsoft.PowerShell PowerShell winget Ok
dir ~\Downloads\Microsoft.PowerShell_7.4.4.0
Directory: C:\Users\user1\Downloads\Microsoft.PowerShell_7.4.4.0
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 8/7/2024 2:05 PM 108404736 PowerShell_7.4.4.0_Machine_X64_wix_en-US.msi
-a--- 8/7/2024 2:05 PM 3838 PowerShell_7.4.4.0_Machine_X64_wix_en-US.yaml
This example shows how to download a package for the current machine and scope. For this example,
the command downloads the latest version of the installer package and manifest for
Microsoft.PowerShell. The command puts the files a new folder in your Downloads location. The
folder name is created by concatenating the package identifier and version number.
Allows you to download package even when the SHA256 hash for an installer or a dependency does not match the SHA256 hash in the WinGet package manifest.
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
Specify the processor architecture for the WinGet package installer.
Type: Microsoft.WinGet.Client.PSObjects.PSProcessorArchitecture
Parameter Sets: (All)
Aliases:
Accepted values: Default, X86, Arm, X64, Arm64
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the location where you want to store the downloaded files.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the WinGet package identifier
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the type of installer package to download. This parameter accepts the following values:
DefaultInnoWixMsiNullsoftZipMsixExeBurnMSStorePortable[!NOTE] The installer type must be available in the WinGet package manifest.
Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallerType
Parameter Sets: (All)
Aliases:
Accepted values: Default, Inno, Wix, Msi, Nullsoft, Zip, Msix, Exe, Burn, MSStore, Portable
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the locale of the installer package. The locale must provided in the BCP 47 format, such as
en-US. For more information, see
Standard locale names.
[!NOTE] The locale must be available in the WinGet package manifest.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the match option for a WinGet package query. This parameter accepts the following values:
EqualsEqualsCaseInsensitiveStartsWithCaseInsensitiveContainsCaseInsensitiveType: Microsoft.WinGet.Client.PSObjects.PSPackageFieldMatchOption
Parameter Sets: FoundSet
Aliases:
Accepted values: Equals, EqualsCaseInsensitive, StartsWithCaseInsensitive, ContainsCaseInsensitive
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the moniker of the WinGet package to download. For example, the moniker for the
Microsoft.PowerShell package is pwsh.
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify the name of the WinGet package.
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Provide PSCatalogPackage object. You can get a PSCatalogPackage object by using the
Find-WinGetPackage command.
Type: Microsoft.WinGet.Client.Engine.PSObjects.PSCatalogPackage
Parameter Sets: GivenSet
Aliases: InputObject
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
One or more strings to search for in the WinGet package. The command searches for matching strings in the following properties of the package manifest:
PackageNamePackageIdentifierMonikerTagsType: System.String[]
Parameter Sets: FoundSet
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specify WinGet package installer scope. The parameter accepts the following values:
AnyUserSystemUserOrUnknownSystemOrUnknown[!NOTE] The installer scope must be available in the WinGet package manifest.
Type: Microsoft.WinGet.Client.PSObjects.PSPackageInstallScope
Parameter Sets: (All)
Aliases:
Accepted values: Any, User, System, UserOrUnknown, SystemOrUnknown
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies that the command shouldn't download the WinGet package dependencies.
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
Specifies WinGet source.
Type: System.String
Parameter Sets: FoundSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the version of the WinGet package to download.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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.