WinGet (App Installer) is already available in MS Store app (new) in Intune. Somehow you cannot find it by name but by ID: 9NBLGGH4NNS1 (this ID can be retrieved from copy link as shown below). So the whole paragraph nr 2 can be addressed easily now
To have any application installed via WinGet you should prepare Win32 app (intunewin). To do it create a separate folder on your machine, e.g.: Google.Chrome. Create there 2 powershell scripts:
- Google.Chrome.ps1
$ResolveWingetPath = Resolve-Path "C:\Program Files\WindowsApps\Microsoft. if ($ResolveWingetPath){ $WingetPath = $ResolveWingetPath[-1].Path } $Wingetpath = Split-Path -Path $WingetPath -Parent cd $wingetpath .\winget.exe install --exact --id Google.Chrome --silent --accept-package-agreements --accept-source-agreements |
- uninstall_Google.Chrome.ps1
$ResolveWingetPath = Resolve-Path "C:\Program Files\WindowsApps\Microsoft. if ($ResolveWingetPath){ $WingetPath = $ResolveWingetPath[-1].Path } $Wingetpath = Split-Path -Path $WingetPath -Parent cd $wingetpath .\winget.exe uninstall --exact --id Google.Chrome --silent |
Looking at the above script, you will notice that the first part is to resolve the DesktopAppInstaller path. Because the Winget command is normally not recognized in the system context.
To create intunewin file which can be uploaded to Intune as source of win32 app follow: https://learn.microsoft.com/
Basically run IntuneWinAppUtil.exe and provide details like below:
Then in C:\temp there will be Google.Chrome.intunewin
As a next step open Intune console ang go to Apps > Windows. Then click Add button and choose: Windows app (win32)
In next step click on Select app package file and provide intunewin file path
In next step provide Name of application in the convention of winget e.g. Google.Chrome or Adobe.Acrobat.Reader.64-bit. You can use: winget search adobe to search winget repository and find out application name.
Edit description and put info that this app is using winget for installation.
In App version field put: newest.
Then click next. On next step fill out like below:
On next step (Requirements) fill out first 2 only.
On Detection rules step configure like below:
Brak komentarzy:
Prześlij komentarz