Skip to content

MisterZeus/winget-installer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

image

GitHub Release Date - Published_At GitHub Downloads - All Releases GitHub Sponsor ko-fi

Install winget from PowerShell

  • Install winget-cli straight from PowerShell
  • Always gets the latest version of winget
  • Works on Windows 10, Windows 11, Server 2022
  • WinGet (and therefore this script) requires "Windows 10 version 1809 or newer (LTSC included)"
  • Does not work on Server 2019

Script Functionality

  • Latest version of Microsoft.UI.Xaml is downloaded and installed.

  • VCLibs and Xaml are installed first

  • Processor architecture is determined for prerequisites

  • VCLibs is installed straight from the appx package

  • Xaml is installed by downloading the nupkg, extracting it, and installing the appx package

  • winget-cli is then installed

  • User PATH variable is adjusted to include WindowsApps folder

  • Grabs the latest version of winget on each run

Setup

Method 1 - PowerShell Gallery

  • In PowerShell, type
Install-Script winget-install -Force
  • answer Yes to all prompts if asked Note: -Force is optional, but it will force the script to update if it is outdated.

The script is published on PowerShell Gallery under winget-install.

Tip - How to trust PSGallery

If you want to trust PSGallery so you aren't prompted each time you run this command, you can type...

Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted

Method 2 - Download Locally and Run

  • Download winget-install.ps1
  • Run the script with .\winget-install.ps1

Usage

In PowerShell, type

winget-install

Available Scripts

  • winget-install.ps1
    • Unsigned script in the repo, signed script in releases

Troubleshooting

  • If you receive an error message about the Appx module not being loaded, try using a different version of PowerShell (version 6 and 7 seem to be buggy still, but the native PowerShell version in Windows works)
  • Open an issue if you run into a persistant problem.

Contributing

If you're like to help develop this project: fork the repo. 😊

About

Install winget tool using PowerShell! Prerequisites automatically installed. Works on Windows 10/11 and Server 2022.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PowerShell 100.0%