20 December 2021

Installing WinGet via PowerShell

 I wanted to install Winget via PowerShell in an automated process. The first thing I did was to go to the Winget GitHub site and select the latest version of the Windows Package Manager. Under the latest version page, I clicked on the file with the extension of msixbundle and downloaded it to my machine.

Now that it is on your machine, you can automate the installation with a PowerShell one-liner script where the PS1 file resides in the same directory as the Winget installer. The script will search the current directory for a msixbundle file with the cmdlet listed below. 

 Add-AppPackage -Path ((Get-ChildItem -Path ((Get-Location).ProviderPath) -Filter *.msixbundle).FullName)  

Related Posts:

  • Configuration Manager Message ID 11170 ErrorI was in the process of pushing out the Microsoft Windows 10 20H2 upgrade when I had 23 systems that errored out. They reported the error shown below. After looking at the logs and at Software Center on the target machin… Read More
  • Automating the Deletion of Windows.oldIt is the beginning of 2021 and my first project for the new year is upgrading all systems to Windows 10 20H2. At the end of the upgrades comes the cleanup and there is no clean way to do this for system admins. Cleanmgr.exe … Read More
  • Installing Printers via ConfigMgr for Non-Admin UsersKB5005652 resolved the "PrintNightMare" vulnerability, but it also brought many companies to a halt when it came to end-users installing printers if they did not have administrator privileges. During the time since the update… Read More
  • PowerShell: Install FontsFont installation using PowerShell has changed since Windows 10 1909. The old way of doing it with PowerShell no longer works. This new script was originally written by Ben Reader who is a fellow Microsoft MVP from Austr… Read More
  • Administrator Reporting ToolThis PowerShell tool queries AD for a list of machines in the specified administrative admin groups. The list is specified by modifying the script with the groups to be queried. The following example shows how to add groups t… Read More

0 comments:

Post a Comment