Use Choco to install apps via Intune
UPDATE 2021-12-06 Changed from install to upgrade as it will still install the package if it is not there and it will now also function as an update script.
Create your Choco App Install Script SetupIntunePC.ps1
:
#Define list of packages
$ChocoPackages = @(
'googlechrome'
,'adobereader'
,'notepadplusplus'
,'7zip'
,'slack'
,'vlc'
,'zoom'
)
$ChocoInstall = Join-Path ([System.Environment]::GetFolderPath(“CommonApplicationData”)) “Chocolatey\bin\choco.exe”
#Check if Chocolatey is installed
if(!(Test-Path $ChocoInstall)) {
try {
Invoke-Expression ((New-Object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1’)) -ErrorAction Stop
}
catch {
Throw “Failed to install Chocolatey”
}
}
#Install packages
foreach($Package in $ChocoPackages) {
try {
Invoke-Expression “cmd.exe /c $ChocoInstall upgrade $Package -y” -ErrorAction Stop
}
catch {
Throw “Failed to install/upgrade $Package”
}
}