- Manage applications individually with a generic and simple Intune deployment script.
- Can also be run locally to update all applications on a machine.
- Recommended to run as Administrator / SYSTEM (primarily implemented for use in Intune)
.\src\Winget-Updatr.ps1 -APPID "7zip.7zip" -OPERATION "install" -ARGS "-e --silent --accept-package-agreements --accept-source-agreements --disable-interactivity"- This is just a wrapper for winget, valid OPERATIONS + ARGS see: Winget CLI README
Before deploying via Intune, test the install and uninstall commands manually.
- Run the install command as SYSTEM (like Intune does)
- Use PsExec to simulate the SYSTEM context:
psexec -i -s cmd.exeThen run your install command:
msiexec /i "C:\Path\to\installer.msi" /qn /l*v "C:\temp\install.log"
powershell -ExecutionPolicy Bypass -File "C:\Path\to\install_script.ps1"Verify that the installation completes successfully.
- Run the uninstall command
Test if your uninstall command works:
msiexec /x {PRODUCT-GUID} /qn
powershell -ExecutionPolicy Bypass -File "C:\Path\to\uninstall_script.ps1"After confirming that installation works manually, you can simulate an Intune deployment test.
- Install the Package Locally via IME
- Copy your .intunewin file to a test machine.
- Manually install using Intune Management Extension (IME)
- Run the following to trigger a local installation:
$IntuneLogPath = "$env:ProgramData\Microsoft\IntuneManagementExtension\Logs"
$IntuneWinAppUtil = "C:\Path\To\YourApp.intunewin"
Start-Process -FilePath "IntuneWinAppUtil.exe" -ArgumentList "/install /quiet" -WaitThis simulates how Intune installs the app. Check logs in C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log.
Once local tests are successful:
- Upload the .intunewin file to Intune via Microsoft Endpoint Manager (MEM).
- Assign the app to a test user or device group.
- Force Intune to sync and deploy immediately:
Start-IntuneManagementExtensionIf issues arise, check logs:
- IME Logs:
C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log - Event Viewer:
- Go to Event Viewer → Applications and Services Logs → Microsoft → Windows → DeviceManagement-Enterprise-Diagnostics-Provider.
- Look for Win32App events.
If using PowerShell scripts, ensure:
- The script doesn't require interactive input.
- Runs in SYSTEM context without errors.
Check registry paths for installation status:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IntuneManagementExtension\Win32AppsHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall