This repository contains a PowerShell module that completes the ability to automatically provide and maintain applications in your software deployment tool by using the Windows Package Manager Repository.
I hope that an official powershell module (maintained by Microsoft) will be available soon, which can be used to accomplish the main goals of this project:
- Automatically provide and maintain packages in software deployment tools (like Microsoft Endpoint Manager Configuration Manager)
- Automatically download and update installers into MDT (Which will be used for Image Factory in my case)
Meanwhile, I built a powershell (v5-compatible) module to prepare the required powershell-scripts to automatically maintain packages in Microsoft Endpoint Manager and MDT.
- Only the public winget repository can be searched (There is no implementation to search private repositories or msstore at the moment)
- No software installations through wingetbridge-cmdlets (requires additional scripts, see "Examples")
Currently, there are no plans to implement more features, because I think the official powershell support for winget-cli will be available soon.
I highly recommend not using WingetBridge in a production environment without validating the downloaded installers before you deploy it. (e.g. by validating the certificate of a signed installer)
v1.3.0.0
- Windows 10 or Windows 11
- .NET Framework 4.8
- Internet connection
After the module is loaded (see Setup)...
- Use "Get-Command -Module endpointmanager.wingetbridge" to get a full list of cmdlets provided by this module.
- Please use e.g. "Get-Help Get-wingetbridge -Examples" to get examples of how to use the corresponding cmdlet.
Search packages in the winget-repository without using the winget-cli.
Start-WingetSearch -SearchByMoniker "vlc"
Search the winget repository by moniker "vlc" (the well known mediaplayer)
Downloads the package manifest (includes package details), and return it as an object
Downloads a specified package installer.
(Start-WingetSearch -SearchByMoniker "vlc" | Get-WingetManifest).Installers | Start-WingetInstallerDownload -AcceptAgreements
Search the winget repository by moniker "vlc" and download all installers provided in the manifest
When using [-AcceptAgreements] you agree any licenses required to download packages.
You can specify a target directory with [-TargetDirectory], otherwise the download will be stored in the current directory.
Updates the cache (local database) for WingetBridge.
It is optional to update the cache before using the cmdlet "Start-WingetSearch", as it updates the cache automatically if required.
Update-WingetBridgeCache -Force
Rebuild the local cache WingetBridge uses.
Saves the default icon that is contained in the specified executable [-SourceFile], to the specified [-TargetIconFile].
When using [-ValidateOnly], only a list of available image resolutions (inside the icon) will be returned by the cmdlet.
Save-WingetBridgeAppIcon -SourceFile "C:\Windows\Explorer.exe" -TargetIconFile "explorer.ico"
Starting with v1.2.0.0, the cmdlet accepts *.ico-files specified with [-SourceFile]
$AvailableInstallers = (Start-WingetSearch -SearchById Adobe.Acrobat.Reader.64-bit | Get-WingetManifest).Installers
foreach ($installer in $AvailableInstallers)
{
if (($installer.InstallerLocale -eq "de-DE") -and ($installer.Architecture -eq "x64"))
{
$DownloadedSetup = Start-WingetInstallerDownload -TargetDirectory C:\Downloads\ -AcceptAgreements -PackageInstaller $installer
Start-Process -FilePath "$($DownloadedSetup.FullPath)" -ArgumentList $($installer.InstallerSwitches.Silent -split " ")
}
}
(Please modify "InstallerLocale" and "TargetDirectory" to your needs)
This sample requires WingetBridge (Powershell-Module) v1.3.0.0 (or higher)
Please take a look on this powershell script: WingetBridge-Factory
- The wingetbridge-PowerShell module is now listed on PowerShell Gallery, therefore it can be installed with:
Install-Module endpointmanager.wingetbridge
-
Extract the folder (endpointmanager.wingetbridge) from the Release-zip to %ProgramFiles%\WindowsPowerShell\Modules\
-
OR use "Import-Module .\endpointmanager.wingetbridge\endpointmanager.wingetbridge.psd1" from the root directory of the extracted Release-zip
-
Make sure you don't have any security-restrictions to load the Powershell-Module. If so, please remove any NTFS Alternate Data Streams (ADS) from the Release-zip before you extract it, and set the ExecutionPolicy to Unrestricted
Unblock-File .\endpointmanager.wingetbridge_v1.3.0.0.zip Set-ExecutionPolicy -ExecutionPolicy Unrestricted
WingetBridge only exists because of the beautiful and hard work of the developers and contributors of Windows Package Manager.
See LICENSE file for licence rights and limitations (MIT)
The author of this module is not responsible for, nor does it grant any licenses to, third-party packages.