You will learn how to package any application in the Winget.exe repository (and there are many) to always have the latest version without repackaging each new release.
No previous skills are needed. Just need to follow along! This is a skill you must know about in 2024.
We will be writing PowerShell scripts called Winget.exe to install and uninstall our software of choice, in this video, we chose Microsoft SQL Management Studio, but you can replace only two words in the scripts and change to any software you want (you need to know the Winget ID of the software but we show how to find that also).
We will also write a detection script, again with the help of winget.exe
Let's get started and thanks for watching!
Links:
github.com/Microsoft/Microsof...
3 SCRIPTS from the video ###
Install-MicrosoftSQLManagementStudioLATESTx86.ps1 - COPY the below ##
Install the latest Microsoft SQL Management Studio from Winget repository
Author: John Bryntze
Date: 2nd February 2024
set variables
$JBNWingetAppID = "Microsoft.SQLServerManagementStudio"
Help SYSTEM find winget.exe folder
Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
Install Microsoft SQL Management Studio software with winget.exe
.\winget.exe install -e --id $JBNWingetAppID --silent --accept-package-agreements --accept-source-agreements --force
Uninstall-MicrosoftSQLManagementStudiox86.ps1 COPY the below ##
Uninstall the latest Microsoft SQL Management Studio from Winget repository
Author: John Bryntze
Date: 2nd February 2024
set variables
$JBNWingetAppID = "Microsoft.SQLServerManagementStudio"
Help SYSTEM find winget.exe folder
Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
Install Microsoft SQL Management Studio software with winget.exe
.\winget.exe Uninstall -e --id $JBNWingetAppID --silent --accept-source-agreements --force
DetectionScriptMicrosoftSQLManagementStudio.ps1 COPY the below ##
Purpose: Checking that locally installed Microsoft SQL Management Studio is equal or greater to the latest found online
Author: John Bryntze
Date: 2nd February 2024
set variables
$JBNWingetAppID = "Microsoft.SQLServerManagementStudio"
Help SYSTEM find winget.exe folder
Set-Location -Path ("$env:ProgramW6432\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe")
What is the latest version online
$JBNSearch = .\winget.exe search -e --id $JBNWingetAppID --accept-source-agreements
$JBNOnlineVersion = (-split $JBNSearch[-1])[-2]
What is the version installed
$JBNLocalSearch = .\winget.exe list -e --id $JBNWingetAppID
#If not installed exit here...
if($JBNLocalSearch[-1] -eq 'No installed package found matching input criteria.')
{
exit 1
#no Microsoft SQL Management Studio is installed...
}
Check if the installed version has a newer version on the web...
$JBNCheckIfAvailavbleExist = (-split $JBNLocalSearch[-3])[-2]
if($JBNCheckIfAvailavbleExist -eq "Available")
{
$JBNLocalVersion = (-split $JBNLocalSearch[-1])[-3]
}
else
{
$JBNLocalVersion = (-split $JBNLocalSearch[-1])[-2]
}
if($JBNLocalVersion -ge $JBNOnlineVersion)
{
Write-Output "The Device got the latest version installed."
exit 0
#Detection success
}
else
{
exit 1
#Detection failed
}
Chapters
00:00:00 Introduction
00:08:25 Package, folder, files, Intunewin file, PowerShell...
00:27:27 Intune Console creating the Win32 App
00:43:03 Install from Company Portal
00:47:10: Outro
Негізгі бет 2024 - Learn package Apps in Microsoft Intune like an expert - become a hero at work!
Пікірлер: 68