Replies: 1 comment
-
I finally got an opportunaty to test this script with psexec.exe and I learned that winget just does not pick up winget repository, even after reset source and update. Updating winget source gets cancelled. Attempt to updating Winget with url msix file does not work in system context, so it cannot be done. So this is no go to Intune unless there is another way to fix the source problem I haven't figure out yet. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been following Winget almost since its beginning and latelly I have taken new approach so since we all know that Winget should no be capable of running under System Context, I am trying to install (2 apps in this example) during Autopilot. The script is below and there is 2 problems with it:
Any suggestions what I should improve in the script? You can also download it from: https://github.com/yannara/Intune/blob/main/Winget_apps_v1.6.ps1
#Create folders for logging New-Item -ItemType directory -Path C:\Intune -ErrorAction SilentlyContinue New-Item -ItemType directory -Path C:\Intune\Logs -ErrorAction SilentlyContinue #Hide LABS folder $f=get-item C:\Intune -Force $f.attributes="Hidden" #Start logging Start-Transcript -Path "C:\Intune\Logs\winget_install_apps_v1.6.log" #Install Winget Install-Module -Name Microsoft.WinGet.Client -Confirm:$False -Force Start-Sleep -Seconds 15 #Reser source Start-Process -FilePath "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" -NoNewWindow -Wait -ArgumentList 'source reset --force' Start-Sleep -Seconds 15 #Upgrade Winget source Start-Process -FilePath "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" -NoNewWindow -Wait -ArgumentList 'source update --disable-interactivity' Start-Sleep -Seconds 15 #Install 7zip with Winget Start-Process -FilePath "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" -NoNewWindow -Wait -ArgumentList 'install 7zip.7zip --silent --accept-package-agreements --accept-source-agreements' Start-Sleep -Seconds 15 #Install VLC player with Winget Start-Process -FilePath "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" -NoNewWindow -Wait -ArgumentList 'install VideoLAN.VLC --silent --accept-package-agreements --accept-source-agreements' Start-Sleep -Seconds 15 #Stop logging Stop-Transcript #Create detection method New-Item "C:\Intune\Logs\winget_install_apps_v1.6.txt" -ItemType File -Value "Winget Application installer"
Beta Was this translation helpful? Give feedback.
All reactions