Skip to main content
Installs a package from the pipeline or from a configured source.

Syntax

Install-WinGetPackage
    [-PSCatalogPackage <PSCatalogPackage>]
    [-Id <string>]
    [-Name <string>]
    [-Moniker <string>]
    [-Source <string>]
    [-Query <string[]>]
    [-Version <string>]
    [-MatchOption <PSPackageFieldMatchOption>]
    [-Mode <PSPackageInstallMode>]
    [-Scope <PSPackageInstallScope>]
    [-Architecture <PSProcessorArchitecture>]
    [-InstallerType <PSPackageInstallerType>]
    [-Override <string>]
    [-Custom <string>]
    [-Location <string>]
    [-Log <string>]
    [-Header <string>]
    [-AllowHashMismatch]
    [-Force]
    [-SkipDependencies]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Install-WinGetPackage cmdlet installs a package from a configured source or from a package object passed through the pipeline. You can specify packages by ID, name, moniker, or by passing a package object from Find-WinGetPackage.

Parameters

PSCatalogPackage
PSCatalogPackage
The package object to install. This parameter accepts pipeline input from Find-WinGetPackage.Aliases: InputObject
Pipeline Input: true
Parameter Set: GivenSet
Id
string
The package identifier to match against. Supports wildcard matching based on the MatchOption parameter.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Name
string
The package name to match against. Supports wildcard matching based on the MatchOption parameter.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Moniker
string
The package moniker to match against. Monikers are short, memorable names for packages.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Source
string
The name of the source to search for packages. If not specified, searches all configured sources.Pipeline Input: true (by property name)
Parameter Set: FoundSet
Query
string[]
One or more strings that match against all fields of a package. Use for general search.Pipeline Input: true (by property name, remaining arguments)
Parameter Set: FoundSet
Position: 0
Version
string
The specific version of the package to install. If not specified, installs the latest version.Pipeline Input: true (by property name)
MatchOption
PSPackageFieldMatchOption
default:"EqualsCaseInsensitive"
Controls how package fields are matched. Valid values:
  • Equals - Exact match (case sensitive)
  • EqualsCaseInsensitive - Exact match (case insensitive)
  • StartsWithCaseInsensitive - Starts with match
  • ContainsCaseInsensitive - Contains match
Pipeline Input: true (by property name)
Parameter Set: FoundSet
Mode
PSPackageInstallMode
default:"Default"
The installation mode. Valid values:
  • Default - Use the package’s default install mode
  • Silent - Silent installation with no UI
  • Interactive - Interactive installation with UI
Pipeline Input: true (by property name)
Scope
PSPackageInstallScope
default:"Any"
The installation scope. Valid values:
  • Any - Install to any available scope
  • User - Install for current user only
  • Machine - Install for all users (requires admin)
Pipeline Input: true (by property name)
Architecture
PSProcessorArchitecture
default:"Default"
The processor architecture to install. Valid values:
  • Default - Use default architecture
  • X86 - 32-bit x86
  • X64 - 64-bit x64
  • Arm - ARM
  • Arm64 - ARM64
Pipeline Input: true (by property name)
InstallerType
PSPackageInstallerType
default:"Default"
The installer type to use. Valid values include:
  • Default - Use package’s default installer
  • Exe - Executable installer
  • Msi - Windows Installer package
  • Msix - MSIX package
  • Inno - Inno Setup installer
  • Nullsoft - NSIS installer
  • Wix - WiX installer
  • Zip - Zip archive
Pipeline Input: true (by property name)
Override
string
Override arguments to pass to the installer, replacing default arguments.Pipeline Input: true (by property name)
Custom
string
Additional custom arguments to pass to the installer in addition to defaults.Pipeline Input: true (by property name)
Location
string
The installation directory. Path can be relative or absolute.Pipeline Input: true (by property name)
Log
string
Path to the log file. The installer’s output will be logged to this file.Pipeline Input: true (by property name)
Header
string
Optional HTTP header to pass to REST-based sources.Pipeline Input: true (by property name)
AllowHashMismatch
switch
Skip the installer hash validation check. Use with caution.Pipeline Input: true (by property name)
Force
switch
Continue installation upon non-security-related failures.Pipeline Input: true (by property name)
SkipDependencies
switch
Skip installing package dependencies.Pipeline Input: true (by property name)
WhatIf
switch
Shows what would happen if the cmdlet runs without actually executing it.
Confirm
switch
Prompts for confirmation before executing the installation.

Outputs

PSInstallResult
object
The result of the installation operation.

Examples

Example 1: Install by ID

Install-WinGetPackage -Id Microsoft.PowerToys
Installs the latest version of PowerToys using the package ID.

Example 2: Install Specific Version

Install-WinGetPackage -Id Microsoft.PowerToys -Version 0.70.0
Installs a specific version of PowerToys.

Example 3: Install from Pipeline

Find-WinGetPackage -Name "Visual Studio Code" | Install-WinGetPackage
Finds a package and installs it via the pipeline.

Example 4: Install with Custom Arguments

Install-WinGetPackage -Id Microsoft.VisualStudioCode -Custom "/SILENT /NORESTART"
Installs Visual Studio Code with custom installer arguments.

Example 5: Install to Specific Location

Install-WinGetPackage -Id Git.Git -Location "C:\Tools\Git"
Installs Git to a custom directory.

Example 6: Install with Logging

Install-WinGetPackage -Id Microsoft.PowerToys -Log "C:\Logs\powertoys-install.log"
Installs PowerToys and logs the output to a file.

Example 7: Install for Current User

Install-WinGetPackage -Id Python.Python.3.11 -Scope User
Installs Python for the current user only (no admin required).

Example 8: Interactive Installation

Install-WinGetPackage -Id Microsoft.Office -Mode Interactive
Installs Office with the interactive installer UI.

Example 9: Install Specific Architecture

Install-WinGetPackage -Id Microsoft.VisualStudioCode -Architecture X64
Installs the 64-bit version of Visual Studio Code.

Example 10: Test Installation with WhatIf

Install-WinGetPackage -Id Microsoft.PowerToys -WhatIf
Shows what would happen without actually installing.

Notes

  • Alias: iswgp
  • Supports -WhatIf and -Confirm parameters
  • Accepts pipeline input from Find-WinGetPackage
  • Default MatchOption is EqualsCaseInsensitive for single package operations
  • Use -Force to continue on non-critical errors
  • Use -SkipDependencies to skip dependency installation

Build docs developers (and LLMs) love