SvRooij.Winget-Intune.Cli
0.7.0-alpha0004
See the version list below for details.
dotnet tool install --global SvRooij.Winget-Intune.Cli --version 0.7.0-alpha0004
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local SvRooij.Winget-Intune.Cli --version 0.7.0-alpha0004
#tool dotnet:?package=SvRooij.Winget-Intune.Cli&version=0.7.0-alpha0004&prerelease
nuke :add-package SvRooij.Winget-Intune.Cli --version 0.7.0-alpha0004
Winget Intune packager CLI
Take any (just msi installers for now) app from winget and upload it to Intune in minutes.
- Downloading the installer and the logo
- Creating an
intunewin
file automatically - Generating the needed script information
- Publish the app to Intune.
This application is Windows only and requires Dotnet 7 to be installed on your computer. It's also a beta application, so please report any issues you find.
A lot of commands run the winget
command, so make sure you have the App Installer installed on your computer as well.
This application used to be Windows only, but recently the main functionality is ported to other platforms by reducing the platform dependencies. This means that the package
and publish
commands should work on any platform that supports dotnet 7. The msi
command is still windows only, as it uses the Microsoft.Deployment.WindowsInstaller
package. Both the package
and publish
won't support other sources than winget
, and will use my open-source winget index, instead of running winget to get the required information.
Installing
This package can be downloaded as a dotnet tool. Make sure you have Dotnet 7 installed on your computer. I'm working to get a code signing certificate, but for now you might have to configure an exception on your computer to run unsigned code.
# Install dotnet 7 sdk (or the way specific for your platform)
winget install --id Microsoft.DotNet.SDK.7 --source winget
# Add the nuget feed, if that is not already done
dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org
# This command will install the tool
dotnet tool install --global Svrooij.Winget-Intune.Cli
# or to update to the latest version
dotnet tool update --global SvRooij.Winget-Intune.Cli
Beta application
This is a beta application, it's not yet ready for production use. I'm still working on it, and I'm looking for feedback. If you found a bug please create an issue, if you have questions or want to share your feedback, check out the discussions page.
Commands
The CLI has several commands, try them out yourself.
Description:
Enhanced Winget CLI for automations
Usage:
winget-intune [command] [options]
Options:
--version Show version information
-?, -h, --help Show help and usage information
Commands:
install <packageId> Installs or upgrades a package
check <packageId> Check if a specific version in installed
info <packageId> Show package info as json
package <packageId> Package an app for Intune
publish <packageId> Publish an packaged app to Intune
msi <msiFile> Extract info from MSI file
about Information about this package and it's author
Package
You should definitely try the package
command. as it's the most important one. Package an app from winget as an intunewin
file, ready for uploading to intune.
You can also expect a detection.ps1
file, that you should configure to be used as detection script in Intune, provided it's not a MSI installer, in that case you can find the detection information in the readme.
It will also write a app.json
file with all the information about the app, for automation purposes.
winget-intune package {PackageId} [--version {version}] [--source winget] --package-folder {PackageFolder}
The
packageId
is case sensitive, so make sure you use the correct casingwill be matches against any package in the open source index. Tip: Copy it from the result of thewinget search {name}
command.
Upon downloading the installer, the SHA256 hash is checked against the one in the winget
manifest, to make sure you won't package a tampered installer.
Previously it used the closed source content-prep-tool to generate the intunewin
file, this has since been replaced with my own faster, open-souce and cross-platform implementation.
Publish
The publish
command will upload the intunewin
file to Intune. You'll need to run the package command first.
Not all packages will work for publishing, you can always try to manually upload the intunewin
file to Intune.
# This app uses the built-in windows authentication, this will trigger a login prompt (or do sso).
winget-intune publish {PackageId} --package-folder {PackageFolder} --tenant {TenantId} --username {Username}
# You can also provide a token, this is useful for automation.
winget-intune publish {PackageId} --package-folder {PackageFolder} --token {Token}
Assignement and categories
You can also assign the app to a group, and set the categories.
# Add --category "Productivity" --category "Utilities" to the command to set the categories (use the exact name!)
winget-intune publish {PackageId} ... --category "Productivity" --category "Utilities"
# Add --available "group-guid" to make the app available to a group (use the guid of the group)
# Add --available "all-users" to make the app available to all users
# Instead of --available you can also use --required to make the app required for the group
# Or if you want to remove the app from the group, use --uninstall
winget-intune publish {PackageId}... --available "3bac8336-623f-46bf-bcab-b5c61e3e5b7a" --available "all-users"
winget-intune publish {PackageId}... --available "3bac8336-623f-46bf-bcab-b5c61e3e5b7a" --available "all-users"
Auto-package
You can also combine the package
and publish
command into one command, this will package the app and publish it to Intune. But this makes debugging harder, so when submitting issues, please don't use this option.
winget-intune publish {PackageId}... --auto-package
Library (soon)
I'm planning to release the actual intune specific code as a separate library, so you can use it in your own projects. This will be released as a separate package.
Contributing
If you want to contribute to this project, please check out the contributing page and the Code of Conduct.
Usefull information
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
0.9.1 | 2,822 | 7/30/2024 |
0.9.0 | 782 | 7/25/2024 |
0.8.9 | 1,566 | 6/13/2024 |
0.8.8 | 1,369 | 5/28/2024 |
0.8.7 | 1,102 | 5/25/2024 |
0.8.6 | 1,628 | 5/7/2024 |
0.8.5 | 1,251 | 5/3/2024 |
0.8.4 | 1,966 | 4/24/2024 |
0.8.3 | 1,791 | 4/9/2024 |
0.8.2 | 662 | 4/7/2024 |
0.8.1 | 1,593 | 4/3/2024 |
0.8.0-alpha0008 | 271 | 1/9/2024 |
0.7.0 | 3,031 | 1/3/2024 |
0.7.0-alpha0007 | 382 | 1/2/2024 |
0.7.0-alpha0004 | 339 | 12/29/2023 |
0.6.1-alpha0002 | 265 | 12/27/2023 |
0.6.1-alpha0001 | 392 | 12/21/2023 |
0.6.0 | 918 | 12/21/2023 |
0.6.0-alpha0014 | 306 | 12/1/2023 |
0.6.0-alpha0013 | 248 | 12/1/2023 |
0.6.0-alpha0012 | 457 | 10/17/2023 |
0.6.0-alpha0010 | 383 | 10/4/2023 |
0.6.0-alpha0009 | 3,701 | 9/26/2023 |
0.6.0-alpha0008 | 323 | 9/23/2023 |
0.5.6-alpha0005 | 371 | 9/20/2023 |
0.5.5 | 557 | 9/18/2023 |
0.5.4 | 1,218 | 9/17/2023 |
0.5.3 | 1,698 | 9/17/2023 |
0.5.2 | 771 | 9/5/2023 |
0.5.1 | 615 | 9/1/2023 |
0.5.0 | 605 | 8/29/2023 |
0.4.1 | 517 | 8/22/2023 |
0.4.0 | 650 | 8/17/2023 |
0.3.0 | 2,365 | 8/16/2023 |
0.2.2 | 1,957 | 8/14/2023 |