![]() |
WGet.NET 4.4.1
A WinGet wrapper library for .Net.
|
The WGetNET.WinGetSourceManager class offers methods to manage the sources used by winget. More...
Public Member Functions | |
WinGetSourceManager () | |
Initializes a new instance of the WGetNET.WinGetSourceManager class. | |
List< WinGetSource > | GetInstalledSources () |
Gets a list of all sources that are installed in winget. | |
List< WinGetSource > | GetInstalledSources (string sourceName) |
Gets a list of installed sources that matches the provided name. | |
async Task< List< WinGetSource > > | GetInstalledSourcesAsync (CancellationToken cancellationToken=default) |
Asynchronously gets a list of all sources that are installed in winget. | |
async Task< List< WinGetSource > > | GetInstalledSourcesAsync (string sourceName, CancellationToken cancellationToken=default) |
Asynchronously gets a list of installed sources that matches the provided name. | |
bool | AddSource (string name, string arg) |
Adds a new source to winget (Needs administrator rights). | |
bool | AddSource (string name, string arg, string type) |
Adds a new source to winget (Needs administrator rights). | |
bool | AddSource (WinGetSource source) |
Adds a new source to winget (Needs administrator rights). | |
bool | AddSource (IEnumerable< WinGetSource > sources) |
Adds multiple new sources to winget (Needs administrator rights). | |
async Task< bool > | AddSourceAsync (string name, string arg, CancellationToken cancellationToken=default) |
Asynchronously adds a new source to winget (Needs administrator rights). | |
async Task< bool > | AddSourceAsync (string name, string arg, string type, CancellationToken cancellationToken=default) |
Asynchronously adds a new source to winget (Needs administrator rights). | |
async Task< bool > | AddSourceAsync (WinGetSource source, CancellationToken cancellationToken=default) |
Asynchronously adds a new source to winget (Needs administrator rights). | |
async Task< bool > | AddSourceAsync (IEnumerable< WinGetSource > sources, CancellationToken cancellationToken=default) |
Asynchronously adds multiple new sources to winget (Needs administrator rights). | |
bool | UpdateSources () |
Updates all sources that are installed in winget. | |
async Task< bool > | UpdateSourcesAsync (CancellationToken cancellationToken=default) |
Asynchronously updates all sources that are installed in winget. | |
void | ExportSourcesToFile (string file) |
Exports the winget sources in json format to a file. | |
void | ExportSourcesToFile (string file, string sourceName) |
Exports the winget sources in json format to a file. | |
void | ExportSourcesToFile (string file, WinGetSource source) |
Exports the winget sources in json format to a file. | |
async Task | ExportSourcesToFileAsync (string file, CancellationToken cancellationToken=default) |
Asynchronously exports the winget sources in json format to a file. | |
async Task | ExportSourcesToFileAsync (string file, string sourceName, CancellationToken cancellationToken=default) |
Asynchronously exports the winget sources in json format to a file. | |
async Task | ExportSourcesToFileAsync (string file, WinGetSource source, CancellationToken cancellationToken=default) |
Asynchronously exports the winget sources in json format to a file. | |
bool | ImportSourcesFromJson (string jsonString) |
Imports sources into winget from a json string. | |
async Task< bool > | ImportSourcesFromJsonAsync (string jsonString, CancellationToken cancellationToken=default) |
Asynchronously imports sources into winget from a json string. | |
bool | ResetSources () |
Resets all sources that are installed in winget (Needs administrator rights). | |
async Task< bool > | ResetSourcesAsync (CancellationToken cancellationToken=default) |
Asynchronously resets all sources that are installed in winget (Needs administrator rights). | |
bool | RemoveSources (string name) |
Removes a source from winget (Needs administrator rights). | |
bool | RemoveSources (WinGetSource source) |
Removes a source from winget (Needs administrator rights). | |
async Task< bool > | RemoveSourcesAsync (string name, CancellationToken cancellationToken=default) |
Asynchronously removes a source from winget (Needs administrator rights). | |
async Task< bool > | RemoveSourcesAsync (WinGetSource source, CancellationToken cancellationToken=default) |
Asynchronously removes a source from winget (Needs administrator rights). | |
string | SourcesToJson (IEnumerable< WinGetSource > sources) |
Generates a valid json string from the provided sources. | |
![]() | |
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< WinGetAdminSetting > | GetAdminSettings () |
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< WinGetInfo > | GetInfoAsync (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< WinGetResult > | ExecuteCustomAsync (WinGetArguments args, CancellationToken cancellationToken=default) |
Asynchronously exectutes WinGet with the provided arguments. | |
async Task< WinGetResult > | ExecuteCustomAsync (string args, CancellationToken cancellationToken=default) |
Asynchronously exectutes WinGet with the provided arguments. | |
Additional Inherited Members | |
![]() | |
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. | |
The WGetNET.WinGetSourceManager class offers methods to manage the sources used by winget.
Definition at line 17 of file WinGetSourceManager.cs.
WGetNET.WinGetSourceManager.WinGetSourceManager | ( | ) |
Initializes a new instance of the WGetNET.WinGetSourceManager class.
Definition at line 22 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.AddSource | ( | IEnumerable< WinGetSource > | sources | ) |
Adds multiple new sources to winget (Needs administrator rights).
sources | A System.Collections.Generic.IEnumerable<T> of WGetNET.WinGetSource objects to add. |
true
if adding all sources was succesfull and false
if one or more failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 270 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.AddSource | ( | string | name, |
string | arg ) |
Adds a new source to winget (Needs administrator rights).
name | A System.String representing the name of the source to add. |
arg | A System.String representing the sources URL or UNC. |
true
if the action was succesfull and false
if it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 156 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.AddSource | ( | string | name, |
string | arg, | ||
string | type ) |
Adds a new source to winget (Needs administrator rights).
name | A System.String representing the name of the source to add. |
arg | A System.String representing the sources URL or UNC. |
type | A System.String representing the source type. |
true
if the action was succesfull and false
if it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 200 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.AddSource | ( | WinGetSource | source | ) |
Adds a new source to winget (Needs administrator rights).
source | The WGetNET.WinGetSource to add. |
true
if the action was succesfull and false
if it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 240 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.AddSourceAsync | ( | IEnumerable< WinGetSource > | sources, |
CancellationToken | cancellationToken = default ) |
Asynchronously adds multiple new sources to winget (Needs administrator rights).
The source type is optional but some sources like the "msstore" need it or adding it wil throw an error.
sources | A System.Collections.Generic.IEnumerable<T> of WGetNET.WinGetSource objects to add. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
true
if adding all sources was succesfull and false
if one or more failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 443 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.AddSourceAsync | ( | string | name, |
string | arg, | ||
CancellationToken | cancellationToken = default ) |
Asynchronously adds a new source to winget (Needs administrator rights).
name | A System.String representing the name of the source to add. |
arg | A System.String representing the sources URL or UNC. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
true
if the action was succesfull and false
if it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 314 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.AddSourceAsync | ( | string | name, |
string | arg, | ||
string | type, | ||
CancellationToken | cancellationToken = default ) |
Asynchronously adds a new source to winget (Needs administrator rights).
name | A System.String representing the name of the source to add. |
arg | A System.String representing the sources URL or UNC. |
type | A System.String representing the source type. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
true
if the action was succesfull and false
if it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 362 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.AddSourceAsync | ( | WinGetSource | source, |
CancellationToken | cancellationToken = default ) |
Asynchronously adds a new source to winget (Needs administrator rights).
source | The WGetNET.WinGetSource to add. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
true
if the action was succesfull and false
if it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 406 of file WinGetSourceManager.cs.
void WGetNET.WinGetSourceManager.ExportSourcesToFile | ( | string | file | ) |
Exports the winget sources in json format to a file.
If the provided file and/or path does not exist, they will be created.
file | The file for the export. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentNullException | A provided argument is null. |
System.ArgumentException | A provided argument is empty.-or-The path contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars. |
System.IO.DirectoryNotFoundException | The directory root does not exist. |
System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
System.IO.IOException | An I/O error occurred while opening the file |
System.NotSupportedException | Path is in an invalid format. |
System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 546 of file WinGetSourceManager.cs.
void WGetNET.WinGetSourceManager.ExportSourcesToFile | ( | string | file, |
string | sourceName ) |
Exports the winget sources in json format to a file.
If the provided file and/or path does not exist, they will be created.
file | The file for the export. |
sourceName | The name of the source for the export. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentNullException | A provided argument is null. |
System.ArgumentException | A provided argument is empty.-or-The path contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars. |
System.IO.DirectoryNotFoundException | The directory root does not exist. |
System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
System.IO.IOException | An I/O error occurred while opening the file |
System.NotSupportedException | Path is in an invalid format. |
System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 594 of file WinGetSourceManager.cs.
void WGetNET.WinGetSourceManager.ExportSourcesToFile | ( | string | file, |
WinGetSource | source ) |
Exports the winget sources in json format to a file.
If the provided file and/or path does not exist, they will be created.
file | The file for the export. |
source | The WGetNET.WinGetSource for the export. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentNullException | A provided argument is null. |
System.ArgumentException | A provided argument is empty.-or-The path contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars. |
System.IO.DirectoryNotFoundException | The directory root does not exist. |
System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
System.IO.IOException | An I/O error occurred while opening the file |
System.NotSupportedException | Path is in an invalid format. |
System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 647 of file WinGetSourceManager.cs.
async Task WGetNET.WinGetSourceManager.ExportSourcesToFileAsync | ( | string | file, |
CancellationToken | cancellationToken = default ) |
Asynchronously exports the winget sources in json format to a file.
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
If the provided file and/or path does not exist, they will be created.
file | The file for the export. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentNullException | A provided argument is null. |
System.ArgumentException | A provided argument is empty.-or-The path contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars. |
System.IO.DirectoryNotFoundException | The directory root does not exist. |
System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
System.IO.IOException | An I/O error occurred while opening the file |
System.NotSupportedException | Path is in an invalid format. |
System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 697 of file WinGetSourceManager.cs.
async Task WGetNET.WinGetSourceManager.ExportSourcesToFileAsync | ( | string | file, |
string | sourceName, | ||
CancellationToken | cancellationToken = default ) |
Asynchronously exports the winget sources in json format to a file.
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
If the provided file and/or path does not exist, they will be created.
file | The file for the export. |
sourceName | The name of the source for the export. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentNullException | A provided argument is null. |
System.ArgumentException | A provided argument is empty.-or-The path contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars. |
System.IO.DirectoryNotFoundException | The directory root does not exist. |
System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
System.IO.IOException | An I/O error occurred while opening the file |
System.NotSupportedException | Path is in an invalid format. |
System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 751 of file WinGetSourceManager.cs.
async Task WGetNET.WinGetSourceManager.ExportSourcesToFileAsync | ( | string | file, |
WinGetSource | source, | ||
CancellationToken | cancellationToken = default ) |
Asynchronously exports the winget sources in json format to a file.
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
If the provided file and/or path does not exist, they will be created.
file | The file for the export. |
source | The WGetNET.WinGetSource for the export. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentNullException | A provided argument is null. |
System.ArgumentException | A provided argument is empty.-or-The path contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars. |
System.IO.DirectoryNotFoundException | The directory root does not exist. |
System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
System.IO.IOException | An I/O error occurred while opening the file |
System.NotSupportedException | Path is in an invalid format. |
System.Security.SecurityException | The caller does not have the required permission. |
Definition at line 811 of file WinGetSourceManager.cs.
List< WinGetSource > WGetNET.WinGetSourceManager.GetInstalledSources | ( | ) |
Gets a list of all sources that are installed in winget.
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
Definition at line 37 of file WinGetSourceManager.cs.
List< WinGetSource > WGetNET.WinGetSourceManager.GetInstalledSources | ( | string | sourceName | ) |
Gets a list of installed sources that matches the provided name.
sourceName | Name of the sources to export. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
Definition at line 60 of file WinGetSourceManager.cs.
async Task< List< WinGetSource > > WGetNET.WinGetSourceManager.GetInstalledSourcesAsync | ( | CancellationToken | cancellationToken = default | ) |
Asynchronously gets a list of all sources that are installed in winget.
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
Definition at line 82 of file WinGetSourceManager.cs.
async Task< List< WinGetSource > > WGetNET.WinGetSourceManager.GetInstalledSourcesAsync | ( | string | sourceName, |
CancellationToken | cancellationToken = default ) |
Asynchronously gets a list of installed sources that matches the provided name.
sourceName | Name of the sources to export. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
Definition at line 115 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.ImportSourcesFromJson | ( | string | jsonString | ) |
Imports sources into winget from a json string.
jsonString | A System.String containing the json for multiple sources. |
true
if importing all sources was successful and false
if on or more failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
WGetNET.Exceptions.InvalidJsonException | The provided JSON could not be deserialized. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 845 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.ImportSourcesFromJsonAsync | ( | string | jsonString, |
CancellationToken | cancellationToken = default ) |
Asynchronously imports sources into winget from a json string.
jsonString | A System.String containing the json for multiple sources. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
true
if importing all sources was successful and false
if on or more failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
WGetNET.Exceptions.InvalidJsonException | The provided JSON could not be deserialized. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 891 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.RemoveSources | ( | string | name | ) |
Removes a source from winget (Needs administrator rights).
name | A System.String representing the name of the source. |
true
if the remove was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 993 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.RemoveSources | ( | WinGetSource | source | ) |
Removes a source from winget (Needs administrator rights).
source | The WGetNET.WinGetSource to remove. |
true
if the remove was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 1023 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.RemoveSourcesAsync | ( | string | name, |
CancellationToken | cancellationToken = default ) |
Asynchronously removes a source from winget (Needs administrator rights).
name | A System.String representing the name of the source. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
true
if the remove was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 1055 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.RemoveSourcesAsync | ( | WinGetSource | source, |
CancellationToken | cancellationToken = default ) |
Asynchronously removes a source from winget (Needs administrator rights).
source | The WGetNET.WinGetSource to remove. |
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
true
if the remove was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.ArgumentException | A provided argument is empty. |
System.ArgumentNullException | A provided argument is null. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 1089 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.ResetSources | ( | ) |
Resets all sources that are installed in winget (Needs administrator rights).
This may take a while depending on the sources.
true
if the reset was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 937 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.ResetSourcesAsync | ( | CancellationToken | cancellationToken = default | ) |
Asynchronously resets all sources that are installed in winget (Needs administrator rights).
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
This may take a while depending on the sources.
true
if the reset was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
System.Security.SecurityException | The current user is missing administrator privileges for this call. |
Definition at line 963 of file WinGetSourceManager.cs.
string WGetNET.WinGetSourceManager.SourcesToJson | ( | IEnumerable< WinGetSource > | sources | ) |
Generates a valid json string from the provided sources.
sources | The System.Collections.Generic.IEnumerable<T> of WinGetSource objects. |
System.ArgumentNullException | A provided argument is null. |
Definition at line 1111 of file WinGetSourceManager.cs.
bool WGetNET.WinGetSourceManager.UpdateSources | ( | ) |
Updates all sources that are installed in winget.
This may take a while depending on the sources.
true
if the update was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
Definition at line 478 of file WinGetSourceManager.cs.
async Task< bool > WGetNET.WinGetSourceManager.UpdateSourcesAsync | ( | CancellationToken | cancellationToken = default | ) |
Asynchronously updates all sources that are installed in winget.
cancellationToken | The System.Threading.CancellationToken for the System.Threading.Tasks.Task. |
This may take a while depending on the sources.
true
if the update was successful or false
if the it failed. WGetNET.Exceptions.WinGetNotInstalledException | WinGet is not installed or not found on the system. |
Definition at line 501 of file WinGetSourceManager.cs.