WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
WGetNET.WinGetPackageManager Class Reference

The WGetNET.WinGetPackageManager class offers methods to manage packages with winget. More...

Inheritance diagram for WGetNET.WinGetPackageManager:
WGetNET.WinGet

Public Member Functions

 WinGetPackageManager ()
 Initializes a new instance of the WGetNET.WinGetPackageManager class.
 
List< WinGetPackageSearchPackage (string packageId, bool exact=false)
 Uses the winget search function to search for a package that maches the given name.
 
List< WinGetPackageSearchPackage (string packageId, string sourceName, bool exact=false)
 Uses the winget search function to search for a package that maches the given name.
 
async Task< List< WinGetPackage > > SearchPackageAsync (string packageId, bool exact=false, CancellationToken cancellationToken=default)
 Uses the winget search function to asynchronously search for a package that maches the given name.
 
async Task< List< WinGetPackage > > SearchPackageAsync (string packageId, string sourceName, bool exact=false, CancellationToken cancellationToken=default)
 Uses the winget search function to asynchronously search for a package that maches the given name.
 
List< WinGetPackageGetInstalledPackages ()
 Gets a list of all installed packages.
 
List< WinGetPackageGetInstalledPackages (string packageId, bool exact=false)
 Gets a list of all installed packages. That match the provided name.
 
List< WinGetPackageGetInstalledPackages (string packageId, string sourceName, bool exact=false)
 Gets a list of all installed packages. That match the provided name.
 
async Task< List< WinGetPackage > > GetInstalledPackagesAsync (CancellationToken cancellationToken=default)
 Asynchronously gets a list of all installed packages.
 
async Task< List< WinGetPackage > > GetInstalledPackagesAsync (string packageId, bool exact=false, CancellationToken cancellationToken=default)
 Asynchronously gets a list of all installed packages. That match the provided name.
 
async Task< List< WinGetPackage > > GetInstalledPackagesAsync (string packageId, string sourceName, bool exact=false, CancellationToken cancellationToken=default)
 Asynchronously gets a list of all installed packages. That match the provided name.
 
WinGetPackageGetExactInstalledPackage (string packageId)
 Gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.
 
WinGetPackageGetExactInstalledPackage (string packageId, string sourceName)
 Gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.
 
async Task< WinGetPackage?> GetExactInstalledPackageAsync (string packageId, CancellationToken cancellationToken=default)
 Asynchronously gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.
 
async Task< WinGetPackage?> GetExactInstalledPackageAsync (string packageId, string sourceName, CancellationToken cancellationToken=default)
 Asynchronously gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.
 
bool InstallPackage (string packageId)
 Install a package using winget.
 
bool InstallPackage (string packageId, bool silent)
 Install a package using winget.
 
bool InstallPackage (WinGetPackage package)
 Install a package using winget.
 
bool InstallPackage (WinGetPackage package, bool silent)
 Install a package using winget.
 
async Task< bool > InstallPackageAsync (string packageId, CancellationToken cancellationToken=default)
 Asynchronously install a package using winget.
 
async Task< bool > InstallPackageAsync (string packageId, bool silent, CancellationToken cancellationToken=default)
 Asynchronously install a package using winget.
 
async Task< bool > InstallPackageAsync (WinGetPackage package, CancellationToken cancellationToken=default)
 Asynchronously install a package using winget.
 
async Task< bool > InstallPackageAsync (WinGetPackage package, bool silent, CancellationToken cancellationToken=default)
 Asynchronously install a package using winget.
 
bool UninstallPackage (string packageId)
 Uninsatll a package using winget.
 
bool UninstallPackage (string packageId, bool silent)
 Uninsatll a package using winget.
 
bool UninstallPackage (WinGetPackage package)
 Uninstall a package using winget.
 
bool UninstallPackage (WinGetPackage package, bool silent)
 Uninstall a package using winget.
 
async Task< bool > UninstallPackageAsync (string packageId, CancellationToken cancellationToken=default)
 Asynchronously uninsatll a package using winget.
 
async Task< bool > UninstallPackageAsync (string packageId, bool silent, CancellationToken cancellationToken=default)
 Asynchronously uninsatll a package using winget.
 
async Task< bool > UninstallPackageAsync (WinGetPackage package, CancellationToken cancellationToken=default)
 Asynchronously uninstall a package using winget.
 
async Task< bool > UninstallPackageAsync (WinGetPackage package, bool silent, CancellationToken cancellationToken=default)
 Asynchronously uninstall a package using winget.
 
List< WinGetPackageGetUpgradeablePackages ()
 Get all upgradeable packages.
 
async Task< List< WinGetPackage > > GetUpgradeablePackagesAsync (CancellationToken cancellationToken=default)
 Asynchronously get all upgradeable packages.
 
bool UpgradePackage (string packageId)
 Upgrades a package using winget.
 
bool UpgradePackage (string packageId, bool silent)
 Upgrades a package using winget.
 
bool UpgradePackage (WinGetPackage package)
 Upgrades a package using winget.
 
bool UpgradePackage (WinGetPackage package, bool silent)
 Upgrades a package using winget.
 
async Task< bool > UpgradePackageAsync (string packageId, CancellationToken cancellationToken=default)
 Asynchronously upgrades a package using winget.
 
async Task< bool > UpgradePackageAsync (string packageId, bool silent, CancellationToken cancellationToken=default)
 Asynchronously upgrades a package using winget.
 
async Task< bool > UpgradePackageAsync (WinGetPackage package, CancellationToken cancellationToken=default)
 Asynchronously upgrades a package using winget.
 
async Task< bool > UpgradePackageAsync (WinGetPackage package, bool silent, CancellationToken cancellationToken=default)
 Asynchronously upgrades a package using winget.
 
bool UpgradeAllPackages ()
 Tries to upgrade all packages using winget.
 
bool UpgradeAllPackages (bool silent)
 Tries to upgrade all packages using winget.
 
async Task< bool > UpgradeAllPackagesAsync (CancellationToken cancellationToken=default)
 Asynchronously tries to upgrade all packages using winget.
 
async Task< bool > UpgradeAllPackagesAsync (bool silent, CancellationToken cancellationToken=default)
 Asynchronously tries to upgrade all packages using winget.
 
bool RepairPackage (string packageId)
 Repairs a package using winget.
 
bool RepairPackage (string packageId, bool silent)
 Repairs a package using winget.
 
bool RepairPackage (WinGetPackage package)
 Repairs a package using winget.
 
bool RepairPackage (WinGetPackage package, bool silent)
 Repairs a package using winget.
 
async Task< bool > RepairPackageAsync (string packageId, CancellationToken cancellationToken=default)
 Asynchronously repairs a package using winget.
 
async Task< bool > RepairPackageAsync (string packageId, bool silent, CancellationToken cancellationToken=default)
 Asynchronously repairs a package using winget.
 
async Task< bool > RepairPackageAsync (WinGetPackage package, CancellationToken cancellationToken=default)
 Asynchronously repair a package using winget.
 
async Task< bool > RepairPackageAsync (WinGetPackage package, bool silent, CancellationToken cancellationToken=default)
 Asynchronously repair a package using winget.
 
bool ExportPackagesToFile (string file)
 Exports a list of all installed winget packages as json to the given file.
 
async Task< bool > ExportPackagesToFileAsync (string file, CancellationToken cancellationToken=default)
 Asynchronously exports a list of all installed winget packages as json to the given file.
 
bool ImportPackagesFromFile (string file)
 Imports packages and trys to installes/upgrade all pakages in the list, if possible.
 
async Task< bool > ImportPackagesFromFileAsync (string file, CancellationToken cancellationToken=default)
 Asynchronously imports packages and trys to installes/upgrade all pakages in the list, if possible.
 
string Hash (string file)
 Executes the WinGet hash function, to calculate the hash for the given file.
 
string Hash (FileInfo file)
 Executes the WinGet hash function, to calculate the hash for the given file.
 
async Task< string > HashAsync (string file, CancellationToken cancellationToken=default)
 Asynchronously executes the WinGet hash function, to calculate the hash for the given file.
 
async Task< string > HashAsync (FileInfo file, CancellationToken cancellationToken=default)
 Asynchronously executes the WinGet hash function, to calculate the hash for the given file.
 
bool Download (string packageId, string directory)
 Downloads the installer of a package using winget.
 
bool Download (string packageId, DirectoryInfo directory)
 Downloads the installer of a package using winget.
 
bool Download (WinGetPackage package, string directory)
 Downloads the installer of a package using winget.
 
bool Download (WinGetPackage package, DirectoryInfo directory)
 Downloads the installer of a package using winget.
 
async Task< bool > DownloadAsync (string packageId, string directory, CancellationToken cancellationToken=default)
 Asynchronously downloads the installer of a package using winget.
 
async Task< bool > DownloadAsync (string packageId, DirectoryInfo directory, CancellationToken cancellationToken=default)
 Asynchronously downloads the installer of a package using winget.
 
async Task< bool > DownloadAsync (WinGetPackage package, string directory, CancellationToken cancellationToken=default)
 Asynchronously downloads the installer of a package using winget.
 
async Task< bool > DownloadAsync (WinGetPackage package, DirectoryInfo directory, CancellationToken cancellationToken=default)
 Asynchronously downloads the installer of a package using winget.
 
List< WinGetPinnedPackageGetPinnedPackages ()
 Gets a list of all pinned packages.
 
async Task< List< WinGetPinnedPackage > > GetPinnedPackagesAsync (CancellationToken cancellationToken=default)
 Asynchronously gets a list of all pinned packages.
 
bool PinAdd (string packageId, bool blocking=false)
 Adds a pinned package to winget.
 
bool PinAdd (string packageId, string version)
 Adds a pinned package to winget.
 
bool PinAdd (WinGetPackage package, bool blocking=false)
 Adds a pinned package to winget.
 
bool PinAdd (WinGetPackage package, string version)
 Adds a pinned package to winget.
 
async Task< bool > PinAddAsync (string packageId, bool blocking=false, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned package to winget.
 
async Task< bool > PinAddAsync (string packageId, string version, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned package to winget.
 
async Task< bool > PinAddAsync (WinGetPackage package, bool blocking=false, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned package to winget.
 
async Task< bool > PinAddAsync (WinGetPackage package, string version, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned package to winget.
 
bool PinAddInstalled (string packageId, bool blocking=false)
 Adds a pinned installed package to winget.
 
bool PinAddInstalled (string packageId, string version)
 Adds a pinned installed package to winget.
 
bool PinAddInstalled (WinGetPackage package, bool blocking=false)
 Adds a pinned installed package to winget.
 
bool PinAddInstalled (WinGetPackage package, string version)
 Adds a pinned installed package to winget.
 
async Task< bool > PinAddInstalledAsync (string packageId, bool blocking=false, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned installed package to winget.
 
async Task< bool > PinAddInstalledAsync (string packageId, string version, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned installed package to winget.
 
async Task< bool > PinAddInstalledAsync (WinGetPackage package, bool blocking=false, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned installed package to winget.
 
async Task< bool > PinAddInstalledAsync (WinGetPackage package, string version, CancellationToken cancellationToken=default)
 Asynchronously adds a pinned installed package to winget.
 
bool PinRemove (string packageId)
 Removes a pinned package from winget.
 
bool PinRemove (WinGetPackage package)
 Removes a pinned package from winget.
 
async Task< bool > PinRemoveAsync (string packageId, CancellationToken cancellationToken=default)
 Asynchronously removes a pinned package from winget.
 
async Task< bool > PinRemoveAsync (WinGetPackage package, CancellationToken cancellationToken=default)
 Asynchronously removes a pinned package from winget.
 
bool PinRemoveInstalled (string packageId)
 Removes a pinned package from winget.
 
bool PinRemoveInstalled (WinGetPackage package)
 Removes a pinned package from winget.
 
async Task< bool > PinRemoveInstalledAsync (string packageId, CancellationToken cancellationToken=default)
 Asynchronously removes a pinned package from winget.
 
async Task< bool > PinRemoveInstalledAsync (WinGetPackage package, CancellationToken cancellationToken=default)
 Asynchronously removes a pinned package from winget.
 
bool ResetPins ()
 Resets all pinned packages.
 
async Task< bool > ResetPinsAsync (CancellationToken cancellationToken=default)
 Asynchronously resets all pinned packages.
 
- Public Member Functions inherited from WGetNET.WinGet
 WinGet ()
 Initializes a new instance of the WGetNET.WinGet class.
 
string ExportSettings ()
 Exports the WinGet settings to a json string.
 
async Task< string > ExportSettingsAsync (CancellationToken cancellationToken=default)
 Asynchronous exports the WinGet settings to a json string.
 
void ExportSettingsToFile (string file)
 Exports the WinGet settings to a json and writes them to the given file.
 
async Task ExportSettingsToFileAsync (string file, CancellationToken cancellationToken=default)
 Asynchronous exports the WinGet settings to a json and writes them to the given file.
 
List< WinGetAdminSettingGetAdminSettings ()
 Gets all winget admin settings.
 
async Task< List< WinGetAdminSetting > > GetAdminSettingsAsync (CancellationToken cancellationToken=default)
 Asynchronously gets all winget admin settings.
 
bool EnableAdminSetting (string settingName)
 Enables the provided admin setting (Needs administrator rights).
 
bool EnableAdminSetting (WinGetAdminSetting setting)
 Enables the provided admin setting (Needs administrator rights).
 
async Task< bool > EnableAdminSettingAsync (string settingName, CancellationToken cancellationToken=default)
 Asynchronously enables the provided admin setting (Needs administrator rights).
 
async Task< bool > EnableAdminSettingAsync (WinGetAdminSetting setting, CancellationToken cancellationToken=default)
 Asynchronously enables the provided admin setting (Needs administrator rights).
 
bool DisableAdminSetting (string settingName)
 Disables the provided admin setting (Needs administrator rights).
 
bool DisableAdminSetting (WinGetAdminSetting setting)
 Disables the provided admin setting (Needs administrator rights).
 
async Task< bool > DisableAdminSettingAsync (string settingName, CancellationToken cancellationToken=default)
 Asynchronously disables the provided admin setting (Needs administrator rights).
 
async Task< bool > DisableAdminSettingAsync (WinGetAdminSetting setting, CancellationToken cancellationToken=default)
 Asynchronously disables the provided admin setting (Needs administrator rights).
 
WinGetInfo GetInfo ()
 Gets all WinGet related data provided by the WinGet info action.
 
async Task< WinGetInfoGetInfoAsync (CancellationToken cancellationToken=default)
 Asynchronous gets all WinGet related data provided by the WinGet info action.
 
WinGetResult ExecuteCustom (WinGetArguments args)
 Exectutes WinGet with the provided arguments.
 
WinGetResult ExecuteCustom (string args)
 Exectutes WinGet with the provided arguments.
 
async Task< WinGetResultExecuteCustomAsync (WinGetArguments args, CancellationToken cancellationToken=default)
 Asynchronously exectutes WinGet with the provided arguments.
 
async Task< WinGetResultExecuteCustomAsync (string args, CancellationToken cancellationToken=default)
 Asynchronously exectutes WinGet with the provided arguments.
 

Additional Inherited Members

- Properties inherited from WGetNET.WinGet
bool IsInstalled [get]
 Gets if winget is installed on the system.
 
bool IsPreview [get]
 Gets if the version of winget is a preview version.
 
string VersionString [get]
 Gets the version number of the winget installation.
 
Version Version [get]
 Gets the version number of the winget installation.
 

Detailed Description

The WGetNET.WinGetPackageManager class offers methods to manage packages with winget.

Definition at line 20 of file WinGetPackageManager.cs.

Constructor & Destructor Documentation

◆ WinGetPackageManager()

WGetNET.WinGetPackageManager.WinGetPackageManager ( )

Initializes a new instance of the WGetNET.WinGetPackageManager class.

Definition at line 29 of file WinGetPackageManager.cs.

Member Function Documentation

◆ Download() [1/4]

bool WGetNET.WinGetPackageManager.Download ( string packageId,
DirectoryInfo directory )

Downloads the installer of a package using winget.

Parameters
packageIdThe id or name of the package to download.
directoryA System.IO.DirectoryInfo object of the directory the files will be downloaded to. It will be created if it does not exist.
Returns
true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2140 of file WinGetPackageManager.cs.

◆ Download() [2/4]

bool WGetNET.WinGetPackageManager.Download ( string packageId,
string directory )

Downloads the installer of a package using winget.

Parameters
packageIdThe id or name of the package to download.
directoryDirectory path the files will be downloaded to. It will be created if it does not exist.
Returns
true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2095 of file WinGetPackageManager.cs.

◆ Download() [3/4]

bool WGetNET.WinGetPackageManager.Download ( WinGetPackage package,
DirectoryInfo directory )

Downloads the installer of a package using winget.

Parameters
packageThe package to download.
directoryA System.IO.DirectoryInfo object of the directory the files will be downloaded to. It will be created if it does not exist.
Returns
true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2202 of file WinGetPackageManager.cs.

◆ Download() [4/4]

bool WGetNET.WinGetPackageManager.Download ( WinGetPackage package,
string directory )

Downloads the installer of a package using winget.

Parameters
packageThe package to download.
directoryDirectory path the files will be downloaded to. It will be created if it does not exist.
Returns
true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2167 of file WinGetPackageManager.cs.

◆ DownloadAsync() [1/4]

async Task< bool > WGetNET.WinGetPackageManager.DownloadAsync ( string packageId,
DirectoryInfo directory,
CancellationToken cancellationToken = default )

Asynchronously downloads the installer of a package using winget.

Parameters
packageIdThe id or name of the package to download.
directoryA System.IO.DirectoryInfo object of the directory the files will be downloaded to. It will be created if it does not exist.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2289 of file WinGetPackageManager.cs.

◆ DownloadAsync() [2/4]

async Task< bool > WGetNET.WinGetPackageManager.DownloadAsync ( string packageId,
string directory,
CancellationToken cancellationToken = default )

Asynchronously downloads the installer of a package using winget.

Parameters
packageIdThe id or name of the package to download.
directoryDirectory path the files will be downloaded to. It will be created if it does not exist.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2239 of file WinGetPackageManager.cs.

◆ DownloadAsync() [3/4]

async Task< bool > WGetNET.WinGetPackageManager.DownloadAsync ( WinGetPackage package,
DirectoryInfo directory,
CancellationToken cancellationToken = default )

Asynchronously downloads the installer of a package using winget.

Parameters
packageThe package to download.
directoryA System.IO.DirectoryInfo object of the directory the files will be downloaded to. It will be created if it does not exist.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2359 of file WinGetPackageManager.cs.

◆ DownloadAsync() [4/4]

async Task< bool > WGetNET.WinGetPackageManager.DownloadAsync ( WinGetPackage package,
string directory,
CancellationToken cancellationToken = default )

Asynchronously downloads the installer of a package using winget.

Parameters
packageThe package to download.
directoryDirectory path the files will be downloaded to. It will be created if it does not exist.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the download was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2320 of file WinGetPackageManager.cs.

◆ ExportPackagesToFile()

bool WGetNET.WinGetPackageManager.ExportPackagesToFile ( string file)

Exports a list of all installed winget packages as json to the given file.

Parameters
fileThe file for the export.
Returns
true if the export was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1807 of file WinGetPackageManager.cs.

◆ ExportPackagesToFileAsync()

async Task< bool > WGetNET.WinGetPackageManager.ExportPackagesToFileAsync ( string file,
CancellationToken cancellationToken = default )

Asynchronously exports a list of all installed winget packages as json to the given file.

Parameters
fileThe file for the export.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the export was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1836 of file WinGetPackageManager.cs.

◆ GetExactInstalledPackage() [1/2]

WinGetPackage? WGetNET.WinGetPackageManager.GetExactInstalledPackage ( string packageId)

Gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.

This method does an internal match and does not use the winget "exact" functionality.

Parameters
packageIdThe id or name of the package for the search.
Returns
A WGetNET.WinGetPackage instances or null if no match was found.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 436 of file WinGetPackageManager.cs.

◆ GetExactInstalledPackage() [2/2]

WinGetPackage? WGetNET.WinGetPackageManager.GetExactInstalledPackage ( string packageId,
string sourceName )

Gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.

This method does an internal match and does not use the winget "exact" functionality.

Parameters
packageIdThe id or name of the package for the search.
sourceNameThe name of the source for the search.
Returns
A WGetNET.WinGetPackage instances or null if no match was found.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 472 of file WinGetPackageManager.cs.

◆ GetExactInstalledPackageAsync() [1/2]

async Task< WinGetPackage?> WGetNET.WinGetPackageManager.GetExactInstalledPackageAsync ( string packageId,
CancellationToken cancellationToken = default )

Asynchronously gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.

This method does an internal match and does not use the winget "exact" functionality.

Parameters
packageIdThe id or name of the package for the search.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A WGetNET.WinGetPackage instances or null if no match was found.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 509 of file WinGetPackageManager.cs.

◆ GetExactInstalledPackageAsync() [2/2]

async Task< WinGetPackage?> WGetNET.WinGetPackageManager.GetExactInstalledPackageAsync ( string packageId,
string sourceName,
CancellationToken cancellationToken = default )

Asynchronously gets a installed package, that matchs the provided id/name. If there are multiple matches, the first match will be returned.

This method does an internal match and does not use the winget "exact" functionality.

Parameters
packageIdThe id or name of the package for the search.
sourceNameThe name of the source for the search.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A WGetNET.WinGetPackage instances or null if no match was found.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 554 of file WinGetPackageManager.cs.

◆ GetInstalledPackages() [1/3]

List< WinGetPackage > WGetNET.WinGetPackageManager.GetInstalledPackages ( )

Gets a list of all installed packages.

Returns
A System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 214 of file WinGetPackageManager.cs.

◆ GetInstalledPackages() [2/3]

List< WinGetPackage > WGetNET.WinGetPackageManager.GetInstalledPackages ( string packageId,
bool exact = false )

Gets a list of all installed packages. That match the provided name.

Parameters
packageIdThe id or name of the package for the search.
exactUse exact match.
Returns
A System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 240 of file WinGetPackageManager.cs.

◆ GetInstalledPackages() [3/3]

List< WinGetPackage > WGetNET.WinGetPackageManager.GetInstalledPackages ( string packageId,
string sourceName,
bool exact = false )

Gets a list of all installed packages. That match the provided name.

Parameters
packageIdThe id or name of the package for the search.
sourceNameThe name of the source for the search.
exactUse exact match.
Returns
A System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 278 of file WinGetPackageManager.cs.

◆ GetInstalledPackagesAsync() [1/3]

async Task< List< WinGetPackage > > WGetNET.WinGetPackageManager.GetInstalledPackagesAsync ( CancellationToken cancellationToken = default)

Asynchronously gets a list of all installed packages.

Parameters
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 308 of file WinGetPackageManager.cs.

◆ GetInstalledPackagesAsync() [2/3]

async Task< List< WinGetPackage > > WGetNET.WinGetPackageManager.GetInstalledPackagesAsync ( string packageId,
bool exact = false,
CancellationToken cancellationToken = default )

Asynchronously gets a list of all installed packages. That match the provided name.

Parameters
packageIdThe id or name of the package for the search.
exactUse exact match.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 344 of file WinGetPackageManager.cs.

◆ GetInstalledPackagesAsync() [3/3]

async Task< List< WinGetPackage > > WGetNET.WinGetPackageManager.GetInstalledPackagesAsync ( string packageId,
string sourceName,
bool exact = false,
CancellationToken cancellationToken = default )

Asynchronously gets a list of all installed packages. That match the provided name.

Parameters
packageIdThe id or name of the package for the search.
sourceNameThe name of the source for the search.
exactUse exact match.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 392 of file WinGetPackageManager.cs.

◆ GetPinnedPackages()

List< WinGetPinnedPackage > WGetNET.WinGetPackageManager.GetPinnedPackages ( )

Gets a list of all pinned packages.

Returns
A System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.

Definition at line 2386 of file WinGetPackageManager.cs.

◆ GetPinnedPackagesAsync()

async Task< List< WinGetPinnedPackage > > WGetNET.WinGetPackageManager.GetPinnedPackagesAsync ( CancellationToken cancellationToken = default)

Asynchronously gets a list of all pinned packages.

Parameters
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.

Definition at line 2414 of file WinGetPackageManager.cs.

◆ GetUpgradeablePackages()

List< WinGetPackage > WGetNET.WinGetPackageManager.GetUpgradeablePackages ( )

Get all upgradeable packages.

Returns
A System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 1087 of file WinGetPackageManager.cs.

◆ GetUpgradeablePackagesAsync()

async Task< List< WinGetPackage > > WGetNET.WinGetPackageManager.GetUpgradeablePackagesAsync ( CancellationToken cancellationToken = default)

Asynchronously get all upgradeable packages.

Parameters
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 1111 of file WinGetPackageManager.cs.

◆ Hash() [1/2]

string WGetNET.WinGetPackageManager.Hash ( FileInfo file)

Executes the WinGet hash function, to calculate the hash for the given file.

Parameters
fileA System.IO.FileInfo object, of the file the hash should be calculated for.
Returns
A System.String containing the hash.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentNullExceptionA provided argument is null.
System.IO.FileNotFoundExceptionUnable to find the specified file.

Definition at line 1983 of file WinGetPackageManager.cs.

◆ Hash() [2/2]

string WGetNET.WinGetPackageManager.Hash ( string file)

Executes the WinGet hash function, to calculate the hash for the given file.

Parameters
fileA System.String containing the path to the file.
Returns
A System.String containing the hash.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.
System.IO.FileNotFoundExceptionUnable to find the specified file.

Definition at line 1946 of file WinGetPackageManager.cs.

◆ HashAsync() [1/2]

async Task< string > WGetNET.WinGetPackageManager.HashAsync ( FileInfo file,
CancellationToken cancellationToken = default )

Asynchronously executes the WinGet hash function, to calculate the hash for the given file.

Parameters
fileA System.IO.FileInfo object, of the file the hash should be calculated for.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.String containing the hash.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentNullExceptionA provided argument is null.
System.IO.FileNotFoundExceptionUnable to find the specified file.

Definition at line 2061 of file WinGetPackageManager.cs.

◆ HashAsync() [2/2]

async Task< string > WGetNET.WinGetPackageManager.HashAsync ( string file,
CancellationToken cancellationToken = default )

Asynchronously executes the WinGet hash function, to calculate the hash for the given file.

Parameters
fileA System.String containing the path to the file.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.String containing the hash.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.
System.IO.FileNotFoundExceptionUnable to find the specified file.

Definition at line 2020 of file WinGetPackageManager.cs.

◆ ImportPackagesFromFile()

bool WGetNET.WinGetPackageManager.ImportPackagesFromFile ( string file)

Imports packages and trys to installes/upgrade all pakages in the list, if possible.

This may take some time and winget may not install/upgrade all packages.

Parameters
fileThe file with the package data for the import.
Returns
true if the import was compleatly successful or false if some or all packages failed to install.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1866 of file WinGetPackageManager.cs.

◆ ImportPackagesFromFileAsync()

async Task< bool > WGetNET.WinGetPackageManager.ImportPackagesFromFileAsync ( string file,
CancellationToken cancellationToken = default )

Asynchronously imports packages and trys to installes/upgrade all pakages in the list, if possible.

This may take some time and winget may not install/upgrade all packages.

Parameters
fileThe file with the package data for the import.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the import was compleatly successful or false if some or all packages failed to install.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1906 of file WinGetPackageManager.cs.

◆ InstallPackage() [1/4]

bool WGetNET.WinGetPackageManager.InstallPackage ( string packageId)

Install a package using winget.

Parameters
packageIdThe id or name of the package for the installation.
Returns
true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 594 of file WinGetPackageManager.cs.

◆ InstallPackage() [2/4]

bool WGetNET.WinGetPackageManager.InstallPackage ( string packageId,
bool silent )

Install a package using winget.

Parameters
packageIdThe id or name of the package for the installation.
silentRequest silent installation of packages.
Returns
true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 620 of file WinGetPackageManager.cs.

◆ InstallPackage() [3/4]

bool WGetNET.WinGetPackageManager.InstallPackage ( WinGetPackage package)

Install a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the installation.
Returns
true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 652 of file WinGetPackageManager.cs.

◆ InstallPackage() [4/4]

bool WGetNET.WinGetPackageManager.InstallPackage ( WinGetPackage package,
bool silent )

Install a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the installation.
silentRequest silent installation of packages.
Returns
true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 681 of file WinGetPackageManager.cs.

◆ InstallPackageAsync() [1/4]

async Task< bool > WGetNET.WinGetPackageManager.InstallPackageAsync ( string packageId,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously install a package using winget.

Parameters
packageIdThe id or name of the package for the installation.
silentRequest silent installation of packages.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 746 of file WinGetPackageManager.cs.

◆ InstallPackageAsync() [2/4]

async Task< bool > WGetNET.WinGetPackageManager.InstallPackageAsync ( string packageId,
CancellationToken cancellationToken = default )

Asynchronously install a package using winget.

Parameters
packageIdThe id or name of the package for the installation.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 713 of file WinGetPackageManager.cs.

◆ InstallPackageAsync() [3/4]

async Task< bool > WGetNET.WinGetPackageManager.InstallPackageAsync ( WinGetPackage package,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously install a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the installation.
silentRequest silent installation of packages.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 815 of file WinGetPackageManager.cs.

◆ InstallPackageAsync() [4/4]

async Task< bool > WGetNET.WinGetPackageManager.InstallPackageAsync ( WinGetPackage package,
CancellationToken cancellationToken = default )

Asynchronously install a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the installation.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the installation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 782 of file WinGetPackageManager.cs.

◆ PinAdd() [1/4]

bool WGetNET.WinGetPackageManager.PinAdd ( string packageId,
bool blocking = false )

Adds a pinned package to winget.

Parameters
packageIdThe id or name of the package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2454 of file WinGetPackageManager.cs.

◆ PinAdd() [2/4]

bool WGetNET.WinGetPackageManager.PinAdd ( string packageId,
string version )

Adds a pinned package to winget.

Parameters
packageIdThe id or name of the package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2498 of file WinGetPackageManager.cs.

◆ PinAdd() [3/4]

bool WGetNET.WinGetPackageManager.PinAdd ( WinGetPackage package,
bool blocking = false )

Adds a pinned package to winget.

Parameters
packageThe package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2533 of file WinGetPackageManager.cs.

◆ PinAdd() [4/4]

bool WGetNET.WinGetPackageManager.PinAdd ( WinGetPackage package,
string version )

Adds a pinned package to winget.

Parameters
packageThe package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2568 of file WinGetPackageManager.cs.

◆ PinAddAsync() [1/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddAsync ( string packageId,
bool blocking = false,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned package to winget.

Parameters
packageIdThe id or name of the package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2604 of file WinGetPackageManager.cs.

◆ PinAddAsync() [2/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddAsync ( string packageId,
string version,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned package to winget.

Parameters
packageIdThe id or name of the package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2652 of file WinGetPackageManager.cs.

◆ PinAddAsync() [3/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddAsync ( WinGetPackage package,
bool blocking = false,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned package to winget.

Parameters
packageThe package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2691 of file WinGetPackageManager.cs.

◆ PinAddAsync() [4/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddAsync ( WinGetPackage package,
string version,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned package to winget.

Parameters
packageThe package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2730 of file WinGetPackageManager.cs.

◆ PinAddInstalled() [1/4]

bool WGetNET.WinGetPackageManager.PinAddInstalled ( string packageId,
bool blocking = false )

Adds a pinned installed package to winget.

Parameters
packageIdThe id or name of the package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2762 of file WinGetPackageManager.cs.

◆ PinAddInstalled() [2/4]

bool WGetNET.WinGetPackageManager.PinAddInstalled ( string packageId,
string version )

Adds a pinned installed package to winget.

Parameters
packageIdThe id or name of the package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2806 of file WinGetPackageManager.cs.

◆ PinAddInstalled() [3/4]

bool WGetNET.WinGetPackageManager.PinAddInstalled ( WinGetPackage package,
bool blocking = false )

Adds a pinned installed package to winget.

Parameters
packageThe package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2841 of file WinGetPackageManager.cs.

◆ PinAddInstalled() [4/4]

bool WGetNET.WinGetPackageManager.PinAddInstalled ( WinGetPackage package,
string version )

Adds a pinned installed package to winget.

Parameters
packageThe package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
Returns
true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2876 of file WinGetPackageManager.cs.

◆ PinAddInstalledAsync() [1/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddInstalledAsync ( string packageId,
bool blocking = false,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned installed package to winget.

Parameters
packageIdThe id or name of the package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2912 of file WinGetPackageManager.cs.

◆ PinAddInstalledAsync() [2/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddInstalledAsync ( string packageId,
string version,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned installed package to winget.

Parameters
packageIdThe id or name of the package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 2960 of file WinGetPackageManager.cs.

◆ PinAddInstalledAsync() [3/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddInstalledAsync ( WinGetPackage package,
bool blocking = false,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned installed package to winget.

Parameters
packageThe package to pin.
blockingSet to true if updating of pinned package should be fully blocked.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3002 of file WinGetPackageManager.cs.

◆ PinAddInstalledAsync() [4/4]

async Task< bool > WGetNET.WinGetPackageManager.PinAddInstalledAsync ( WinGetPackage package,
string version,
CancellationToken cancellationToken = default )

Asynchronously adds a pinned installed package to winget.

Parameters
packageThe package to pin.
versionSystem.String representing the version to pin. Please refer to the WinGet documentation for more info about version pinning.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the pin was added successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3041 of file WinGetPackageManager.cs.

◆ PinRemove() [1/2]

bool WGetNET.WinGetPackageManager.PinRemove ( string packageId)

Removes a pinned package from winget.

Parameters
packageIdThe id or name of the package to unpin.
Returns
true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3074 of file WinGetPackageManager.cs.

◆ PinRemove() [2/2]

bool WGetNET.WinGetPackageManager.PinRemove ( WinGetPackage package)

Removes a pinned package from winget.

Parameters
packageThe package to unpin.
Returns
true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3107 of file WinGetPackageManager.cs.

◆ PinRemoveAsync() [1/2]

async Task< bool > WGetNET.WinGetPackageManager.PinRemoveAsync ( string packageId,
CancellationToken cancellationToken = default )

Asynchronously removes a pinned package from winget.

Parameters
packageIdThe id or name of the package to unpin.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3142 of file WinGetPackageManager.cs.

◆ PinRemoveAsync() [2/2]

async Task< bool > WGetNET.WinGetPackageManager.PinRemoveAsync ( WinGetPackage package,
CancellationToken cancellationToken = default )

Asynchronously removes a pinned package from winget.

Parameters
packageThe package to unpin.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3179 of file WinGetPackageManager.cs.

◆ PinRemoveInstalled() [1/2]

bool WGetNET.WinGetPackageManager.PinRemoveInstalled ( string packageId)

Removes a pinned package from winget.

Parameters
packageIdThe id or name of the package to unpin.
Returns
true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3210 of file WinGetPackageManager.cs.

◆ PinRemoveInstalled() [2/2]

bool WGetNET.WinGetPackageManager.PinRemoveInstalled ( WinGetPackage package)

Removes a pinned package from winget.

Parameters
packageThe package to unpin.
Returns
true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3243 of file WinGetPackageManager.cs.

◆ PinRemoveInstalledAsync() [1/2]

async Task< bool > WGetNET.WinGetPackageManager.PinRemoveInstalledAsync ( string packageId,
CancellationToken cancellationToken = default )

Asynchronously removes a pinned package from winget.

Parameters
packageIdThe id or name of the package to unpin.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3278 of file WinGetPackageManager.cs.

◆ PinRemoveInstalledAsync() [2/2]

async Task< bool > WGetNET.WinGetPackageManager.PinRemoveInstalledAsync ( WinGetPackage package,
CancellationToken cancellationToken = default )

Asynchronously removes a pinned package from winget.

Parameters
packageThe package to unpin.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the removal of the pin was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 3315 of file WinGetPackageManager.cs.

◆ RepairPackage() [1/4]

bool WGetNET.WinGetPackageManager.RepairPackage ( string packageId)

Repairs a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageIdThe id or name of the package for the repair action.
Returns
true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1504 of file WinGetPackageManager.cs.

◆ RepairPackage() [2/4]

bool WGetNET.WinGetPackageManager.RepairPackage ( string packageId,
bool silent )

Repairs a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageIdThe id or name of the package for the repair action.
silentRequest silent package repair.
Returns
true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1539 of file WinGetPackageManager.cs.

◆ RepairPackage() [3/4]

bool WGetNET.WinGetPackageManager.RepairPackage ( WinGetPackage package)

Repairs a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageThe WGetNET.WinGetPackage for the repair action.
Returns
true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1580 of file WinGetPackageManager.cs.

◆ RepairPackage() [4/4]

bool WGetNET.WinGetPackageManager.RepairPackage ( WinGetPackage package,
bool silent )

Repairs a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageThe WGetNET.WinGetPackage for the repair action.
silentRequest silent package repair.
Returns
true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1613 of file WinGetPackageManager.cs.

◆ RepairPackageAsync() [1/4]

async Task< bool > WGetNET.WinGetPackageManager.RepairPackageAsync ( string packageId,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously repairs a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageIdThe id or name of the package for the repair action.
silentRequest silent package repair.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1695 of file WinGetPackageManager.cs.

◆ RepairPackageAsync() [2/4]

async Task< bool > WGetNET.WinGetPackageManager.RepairPackageAsync ( string packageId,
CancellationToken cancellationToken = default )

Asynchronously repairs a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageIdThe id or name of the package for the repair action.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1649 of file WinGetPackageManager.cs.

◆ RepairPackageAsync() [3/4]

async Task< bool > WGetNET.WinGetPackageManager.RepairPackageAsync ( WinGetPackage package,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously repair a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageThe WGetNET.WinGetPackage for the repair action.
silentRequest silent package repair.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1777 of file WinGetPackageManager.cs.

◆ RepairPackageAsync() [4/4]

async Task< bool > WGetNET.WinGetPackageManager.RepairPackageAsync ( WinGetPackage package,
CancellationToken cancellationToken = default )

Asynchronously repair a package using winget.

Limited to packages with an installer that supports this function.

Parameters
packageThe WGetNET.WinGetPackage for the repair action.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the repair action was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1740 of file WinGetPackageManager.cs.

◆ ResetPins()

bool WGetNET.WinGetPackageManager.ResetPins ( )

Resets all pinned packages.

This will remove all pins and it is not possible to restore them.

Returns
true if the reset was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.

Definition at line 3344 of file WinGetPackageManager.cs.

◆ ResetPinsAsync()

async Task< bool > WGetNET.WinGetPackageManager.ResetPinsAsync ( CancellationToken cancellationToken = default)

Asynchronously resets all pinned packages.

Parameters
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.

This will remove all pins and it is not possible to restore them.

Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the reset was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
WGetNET.Exceptions.WinGetFeatureNotSupportedExceptionThis feature is not supported in the installed WinGet version.

Definition at line 3375 of file WinGetPackageManager.cs.

◆ SearchPackage() [1/2]

List< WinGetPackage > WGetNET.WinGetPackageManager.SearchPackage ( string packageId,
bool exact = false )

Uses the winget search function to search for a package that maches the given name.

Parameters
packageIdThe id or name of the package for the search.
exactUse exact match.
Returns
A System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 54 of file WinGetPackageManager.cs.

◆ SearchPackage() [2/2]

List< WinGetPackage > WGetNET.WinGetPackageManager.SearchPackage ( string packageId,
string sourceName,
bool exact = false )

Uses the winget search function to search for a package that maches the given name.

Parameters
packageIdThe id or name of the package for the search.
sourceNameThe name of the source for the search.
exactUse exact match.
Returns
A System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 92 of file WinGetPackageManager.cs.

◆ SearchPackageAsync() [1/2]

async Task< List< WinGetPackage > > WGetNET.WinGetPackageManager.SearchPackageAsync ( string packageId,
bool exact = false,
CancellationToken cancellationToken = default )

Uses the winget search function to asynchronously search for a package that maches the given name.

Parameters
packageIdThe id or name of the package for the search.
exactUse exact match.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 132 of file WinGetPackageManager.cs.

◆ SearchPackageAsync() [2/2]

async Task< List< WinGetPackage > > WGetNET.WinGetPackageManager.SearchPackageAsync ( string packageId,
string sourceName,
bool exact = false,
CancellationToken cancellationToken = default )

Uses the winget search function to asynchronously search for a package that maches the given name.

Parameters
packageIdThe id or name of the package for the search.
sourceNameThe name of the source for the search.
exactUse exact match.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is a System.Collections.Generic.List<T> of WGetNET.WinGetPackage instances.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 180 of file WinGetPackageManager.cs.

◆ UninstallPackage() [1/4]

bool WGetNET.WinGetPackageManager.UninstallPackage ( string packageId)

Uninsatll a package using winget.

Parameters
packageIdThe id or name of the package for uninstallation.
Returns
true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 845 of file WinGetPackageManager.cs.

◆ UninstallPackage() [2/4]

bool WGetNET.WinGetPackageManager.UninstallPackage ( string packageId,
bool silent )

Uninsatll a package using winget.

Parameters
packageIdThe id or name of the package for uninstallation.
silentRequest silent package uninstall.
Returns
true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 871 of file WinGetPackageManager.cs.

◆ UninstallPackage() [3/4]

bool WGetNET.WinGetPackageManager.UninstallPackage ( WinGetPackage package)

Uninstall a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the uninstallation.
Returns
true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 903 of file WinGetPackageManager.cs.

◆ UninstallPackage() [4/4]

bool WGetNET.WinGetPackageManager.UninstallPackage ( WinGetPackage package,
bool silent )

Uninstall a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the uninstallation.
silentRequest silent package uninstall.
Returns
true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 932 of file WinGetPackageManager.cs.

◆ UninstallPackageAsync() [1/4]

async Task< bool > WGetNET.WinGetPackageManager.UninstallPackageAsync ( string packageId,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously uninsatll a package using winget.

Parameters
packageIdThe id or name of the package for uninstallation.
silentRequest silent package uninstall.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 994 of file WinGetPackageManager.cs.

◆ UninstallPackageAsync() [2/4]

async Task< bool > WGetNET.WinGetPackageManager.UninstallPackageAsync ( string packageId,
CancellationToken cancellationToken = default )

Asynchronously uninsatll a package using winget.

Parameters
packageIdThe id or name of the package for uninstallation.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 964 of file WinGetPackageManager.cs.

◆ UninstallPackageAsync() [3/4]

async Task< bool > WGetNET.WinGetPackageManager.UninstallPackageAsync ( WinGetPackage package,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously uninstall a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the uninstallation.
silentRequest silent package uninstall.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1064 of file WinGetPackageManager.cs.

◆ UninstallPackageAsync() [4/4]

async Task< bool > WGetNET.WinGetPackageManager.UninstallPackageAsync ( WinGetPackage package,
CancellationToken cancellationToken = default )

Asynchronously uninstall a package using winget.

Parameters
packageThe WGetNET.WinGetPackage for the uninstallation.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the uninstallation was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1031 of file WinGetPackageManager.cs.

◆ UpgradeAllPackages() [1/2]

bool WGetNET.WinGetPackageManager.UpgradeAllPackages ( )

Tries to upgrade all packages using winget.

The action might run succesfully without upgrading every or even any package.

Returns
true if the action run successfully or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 1391 of file WinGetPackageManager.cs.

◆ UpgradeAllPackages() [2/2]

bool WGetNET.WinGetPackageManager.UpgradeAllPackages ( bool silent)

Tries to upgrade all packages using winget.

The action might run succesfully without upgrading every or even any package.

Parameters
silentRequest silent upgrade of packages.
Returns
true if the action run successfully or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 1411 of file WinGetPackageManager.cs.

◆ UpgradeAllPackagesAsync() [1/2]

async Task< bool > WGetNET.WinGetPackageManager.UpgradeAllPackagesAsync ( bool silent,
CancellationToken cancellationToken = default )

Asynchronously tries to upgrade all packages using winget.

Parameters
silentRequest silent upgrade of packages.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.

The action might run succesfully without upgrading every or even any package.

Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the action run successfully or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 1468 of file WinGetPackageManager.cs.

◆ UpgradeAllPackagesAsync() [2/2]

async Task< bool > WGetNET.WinGetPackageManager.UpgradeAllPackagesAsync ( CancellationToken cancellationToken = default)

Asynchronously tries to upgrade all packages using winget.

Parameters
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.

The action might run succesfully without upgrading every or even any package.

Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the action run successfully or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.

Definition at line 1441 of file WinGetPackageManager.cs.

◆ UpgradePackage() [1/4]

bool WGetNET.WinGetPackageManager.UpgradePackage ( string packageId)

Upgrades a package using winget.

Parameters
packageIdThe id or name of the package that should be upgraded.
Returns
true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1146 of file WinGetPackageManager.cs.

◆ UpgradePackage() [2/4]

bool WGetNET.WinGetPackageManager.UpgradePackage ( string packageId,
bool silent )

Upgrades a package using winget.

Parameters
packageIdThe id or name of the package that should be upgraded.
silentRequest silent upgrade of packages.
Returns
true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1172 of file WinGetPackageManager.cs.

◆ UpgradePackage() [3/4]

bool WGetNET.WinGetPackageManager.UpgradePackage ( WinGetPackage package)

Upgrades a package using winget.

Parameters
packageThe WGetNET.WinGetPackage that should be upgraded.
Returns
true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1204 of file WinGetPackageManager.cs.

◆ UpgradePackage() [4/4]

bool WGetNET.WinGetPackageManager.UpgradePackage ( WinGetPackage package,
bool silent )

Upgrades a package using winget.

Parameters
packageThe WGetNET.WinGetPackage that should be upgraded.
silentRequest silent upgrade of packages.
Returns
true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1233 of file WinGetPackageManager.cs.

◆ UpgradePackageAsync() [1/4]

async Task< bool > WGetNET.WinGetPackageManager.UpgradePackageAsync ( string packageId,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously upgrades a package using winget.

Parameters
packageIdThe id or name of the package that should be upgraded.
silentRequest silent upgrade of packages.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1298 of file WinGetPackageManager.cs.

◆ UpgradePackageAsync() [2/4]

async Task< bool > WGetNET.WinGetPackageManager.UpgradePackageAsync ( string packageId,
CancellationToken cancellationToken = default )

Asynchronously upgrades a package using winget.

Parameters
packageIdThe id or name of the package that should be upgraded.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1265 of file WinGetPackageManager.cs.

◆ UpgradePackageAsync() [3/4]

async Task< bool > WGetNET.WinGetPackageManager.UpgradePackageAsync ( WinGetPackage package,
bool silent,
CancellationToken cancellationToken = default )

Asynchronously upgrades a package using winget.

Parameters
packageThe WGetNET.WinGetPackage that should be upgraded.
silentRequest silent upgrade of packages.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1367 of file WinGetPackageManager.cs.

◆ UpgradePackageAsync() [4/4]

async Task< bool > WGetNET.WinGetPackageManager.UpgradePackageAsync ( WinGetPackage package,
CancellationToken cancellationToken = default )

Asynchronously upgrades a package using winget.

Parameters
packageThe WGetNET.WinGetPackage that should be upgraded.
cancellationTokenThe System.Threading.CancellationToken for the System.Threading.Tasks.Task.
Returns
A System.Threading.Tasks.Task, containing the result. The result is true if the upgrade was successful or false if it failed.
Exceptions
WGetNET.Exceptions.WinGetNotInstalledExceptionWinGet is not installed or not found on the system.
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 1334 of file WinGetPackageManager.cs.