Using winget on Windows 10 and Windows 11                                                                                                                  last update:  19.11.2023
==================================

# In September 2023 winget was not working.

# When running 'winget install Teams.Teams' it did.....Nothing.

# 'winget source list ' showed:

   Name    Argument
   -----------------------------------------------------
   msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0
   winget  https://cdn.azureedge.microsoft.com/cache


# Calling 'nslookup' i got:

   nslookup cdn.winget.microsoft.com
  
   Name:    sni1gl.wpc.nucdn.net
   Addresses:  2606:2800:233:1cb7:261b:1f9c:2074:3c
             152.199.21.175
   Aliases:  cdn.winget.microsoft.com
             winget.azureedge.net
             winget.ec.azureedge.net
             scdn283e9.wpc.14d639.nucdn.net

# I queried the versions of the app-installer components:

   Get-AppxPackage | sort PackageFamilyName | select PackageFamilyName, Version | findstr ('Microsoft.UI | Microsoft.DesktopAppInstaller |  Microsoft.VCLibs | Microsoft.EdgeWebView2Runtime')

# and found out that  Microsoft.UI.Xaml  and  Microsoft.DesktopAppInstaller  from the Windows 11 Image 22H2 were old.

# To install the actual versions refer to the microsoft site:

https://learn.microsoft.com/en-us/windows/package-manager/winget/
https://learn.microsoft.com/de-de/windows/package-manager/winget/

# or use this in powershell with admin rights:

   #################################################################
   $progressPreference = 'silentlyContinue'
   Write-Information "Downloading WinGet and its dependencies..."
   Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
   Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
   Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile Microsoft.UI.Xaml.2.7.x64.appx
   Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
   Add-AppxPackage Microsoft.UI.Xaml.2.7.x64.appx
   Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
   #################################################################

# Refering to the site you can use this to have WINGET on Windows 10
# Since the VClibs on the image are newer in Windows 11, you can leave them out.
# Since the version of UI.Xaml on github is newer, you can adjust that.

   #################################################################
   $progressPreference = 'silentlyContinue'
   Write-Information "Downloading WinGet and its dependencies..."
   Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
   Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.5/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx
   Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx
   Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
#################################################################

# Run this Code in powershell with admin rights.

# qery  'winget source list ' again showed:

   Name    Argument
   -----------------------------------------------------
   msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0
   winget  https://cdn.winget.microsoft.com/cache

## Please note the second line with the winget URL.

# The first installation call with winget requires agreement approval:

   winget install notepad++.notepad++ -e --accept-source-agreements