Hey guys, so this post is all about my experience with Windows Package Manager and it may help you learn a bit with me. Let’s discuss little about the background and then we will see how to use this tool and how we can push applications from Intune.
Microsoft has already announced that Windows store for business and education are getting retired in the first quarter of 2023. You can check it from here.
Now, how we will install the apps that were available in windows store or how would you be able to push any custom apps to your endpoints. Microsoft has a comprehensive package manager solution which is Windows Package Manager or in short, a command line tool called Winget.
According to Microsoft – “A package manager is a system or set of tools used to automate installing, upgrading, configuring and using software. The Winget command line tool enables users to discover, install, upgrade, remove and configure applications on Windows 10 and Windows 11 computers. This tool is the client interface to the Windows Package Manager service.”
How to Install Winget
By default, Winget is installed on all the Windows 10 and Windows 11 latest versions, but if you are using older versions of Windows there are 2 ways using which we can install the Winget tool.
1. Get the app from the windows app store, it is available by the name App installer and you can get it installed very easily without any issues

2. The other way to install the client is to get the installer bundle downloaded from GitHub.

When the page opens, from the bottom select the tool and download.

When downloaded, run the installer if Winget is old version it will update else it will perform a fresh install.

NOTE: this doesn’t work on Windows 11 as it might have an updated version already.🙂
Once winget is installed how would you verify that its installed properly, well very simple. Just open PowerShell and type winget, below screen appears:

How to use Winget to install apps
In the above PowerShell screen we can see that when we type winget we get many information with it, like the installed version, the commands and the parameters.
Co
Below are the list of commands along with its description that you can use in winget to perform any operation.

Options
Below are the set of option you can use with winget

Supported Installer Formats
The winget tool supports the below installer formats:
· EXE (with Silent and SilentWithProgress flags)
· INNO
· NULLSOFT
· MSI
· APPX
· MSIX
· BURN
· PORTABLE
Now we have seen that what are the commands, supported installer formats and options that we can use with winget, let’s now try to install our first app. Let us suppose that we want to install Notepad ++ on our system.
The first step to do here, we will want to search an app with the name notepad++ so in below screen, we see the search command to be used with Winget.

In above screen we see that when we search for the app, a license agreement statement appears which you have to accept by typing Y for yes for the first time. After that you can see that the apps which are available with the name Notepad are shown as a list.
We would now need to install the app which is at the top of list. So for that we would need to run the install command, let’s ee what happens when we run the blow command:
Winget install Notepad++

Wow😯, it is so easy, it installed within seconds. Looks great right. We can also verify in our computer whether it installed or not. So lets go to windows start an check

Well, this is all good but what happens if there are multiple apps with same name, then instead of using above command to install, use --id option, the install command changes to below:
winget install --id=Notepad++.Notepad++ -e
It installs the same application but with id parameter.
Now, if I want to install multiple apps at a time or bulk app at a time, can I do that using winget. Off course yes, we can do that. Command for the same is provided below:
winget install --id=Microsoft.Teams -e ; winget install --id=Zoom.Zoom -e ; winget install --id=SlackTechnologies.Slack -e ; winget install --id=ShareX.ShareX -e
Awesome😎, we can install many apps together at once.
What if, you want uninstall the app, very simple run the below command
Winget uninstall Notepad++

We now know how to install apps, multiple apps together and uninstall apps using winget. Let’s see in the next section how we can do the same from Intune.
How to install apps from Intune using winget
At this moment, there is no assigned setting or configuration in Intune that you can use to deploy apps using Winget but there were few discussions to integrate Windows Package Manager with Intune.
If you want to deploy or install an app using Intune create a PowerShell script and then deploy to your devices by creating a win32 app.
Follow the process below:
1. Create a .ps1 file with your commandline

2. Create a win32 app with below properties

3. Lets now create a win32 app in intune

4. Go through the process to upload the .intunewin file and use the below properties for Install and Uninstall command:
Install command :
powershell.exe -executionpolicy bypass -windowstyle hidden .\Notepad_Install.ps1
Uninstall command :
"%ProgramFiles%\Notepad++\uninstall.exe" /S
Install Behavior - User
Note: Install behavior should always be chosen as User for Winget apps otherwise Intune Management Extension would not know the path for desktop app installer in windows which is used by Winget to install apps.🙂

5. Then on the Requirements tab select OS architecture and Minimum OS version. Click next

6. Then create a Detection rule for the app –

7. Next in Assignment make the app available for installation in company portal.

Now, when I go to my Hyper V test machine and check the company portal app I see the Notepad++ app available for Installation.

When I click on install it just installs fine with all the messages as you can see below

Ok, we have learnt until now how we can use winget and how to deploy apps from Intune using winget. Let’s now see how we can troubleshoot
How to troubleshoot
Logs
Winget by default creates logs when it is used to install any app. You can find the logs in the below path:
%LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
When I checked the same path in my test hyper V device here's something it looked like

If you want more logs or detail logs, include --verbose-logs on the command line as well. Below is the example of how to use verbose with the command line.
> winget install vscode --verbose-logs
> winget search -n visual --verbose-logs
> winget source add -n mysource -t Microsoft.REST -a https://www.contoso.org --verbose-logs
How to Build Custom packages
To create and submit your own package you would first require to install wingetcreate module:
Open PowerShell and execute below command
Winget install wingetcreate

Once the module is successfully installed lets create a custom app by running the below command
Wingetcreate new

It asks for an url, when you provide it, it will download and parse the same and then it will ask you few questions, follow the instruction as asked and enter all details like below:



when you select Yes to submit your manifest, a GitHub login will initiate with a code.
You have to enter your GitHub creds and code



If every thing is good your manifest will automatically be uploaded and custom app will be created.
Your PowerShell screen will provide the below message:

you can see your request in GitHub

So, In this blog we see how to use Winget to install apps manually as well as from Intune and then how to build our own custom packages. You guys can explore more and create your custom packages as required. It looks really great and has many capabilities if you use properly. 🤓
Hope to see Windows Package Manager integrated to Intune soon so that our job becomes more easy.
OK then we are done here for this post. I will come back with new post and new experience again until then…Cheers🍺🍺
Hi,
Hello, I'm doing the same thing, I'm sending it from intune as win32, but I'm getting the error as below. Where could I have gone wrong?
2022-09-19 13:03:47.576 [CORE] WinGet, version [1.3.2091], activity [{6172BA33-5A26-43E1-BA9B-A753F011E16B}]
2022-09-19 13:03:47.576 [CORE] OS: Windows.Desktop v10.0.22000.978
2022-09-19 13:03:47.576 [CORE] Command line Args: "C:\Users\usernamer\AppData\Local\Microsoft\WindowsApps\winget.exe"
2022-09-19 13:03:47.576 [CORE] Package: Microsoft.DesktopAppInstaller v1.18.2091.0
2022-09-19 13:03:47.576 [CORE] IsCOMCall:0; Caller: winget-cli
2022-09-19 13:03:47.582 [CLI ] WinGet invoked with arguments:
2022-09-19 13:03:47.582 [CLI ] Leaf command to execute: root
2022-09-19 13:03:47.582 [CLI ] Executing command: root
2022-09-19 13:03:47.605 [CLI ] Leaf command succeeded: root