Comments (4)
Thank you!
from wget.net.
Yes sorry, I haven't created proper documentation yet.
The namespace you need is WGetNET (using WGetNET;
).
In this namespace you will find the three classes you can use to perform actions or get information with winget.
WinGetInfo:
The WinGetInfo class can be used to get information about winget itself.
If you want to check if winget is installed and what version is installed, this is the class you should use.
Checking if winget is installed could look like this:
WinGetInfo wingetInfo = new WinGetInfo();
if (wingetInfo.WinGetInstalled)
{
Console.WriteLine("WinGet is installed.");
}
else
{
Console.WriteLine("WinGet is NOT installed.");
}
WinGetPackageManager:
The WinGetPackageManager class is used for everything that has to do with packages.
If you want to install a package for example, you would use this class.
Ther code for installing a package could look like this:
WinGetPackageManager packageManager = new WinGetPackageManager();
packageManager.InstallPackage("Git.Git");
WinGetSourceManager:
The ‘WinGetPackageManager’ class is used for everything that has to do with sources.
If you want to add a source for example, you would use this class.
The code for adding a source could look like this:
WinGetSourceManager sourceManager = new WinGetSourceManager();
sourceManager.AddSource("msstore", "https://storeedgefd.dsx.mp.microsoft.com/v9.0", "Microsoft.Rest");
I hope this will help you getting started.
If you need any help with specific functions or if you have any other questions, I am happy to help.
I will try to add samples and documentation soon.
from wget.net.
Thanks for the quick reply, how do i search using this wrapper?
from wget.net.
Searching for packages can be done like this:
WinGetPackageManager packageManager = new WinGetPackageManager();
List<WinGetPackage> packages = packageManager.SearchPackage("Git");
from wget.net.
Related Issues (12)
- Process buffer width is too short for output list parsing HOT 1
- Add CreateNoWindow = true feature HOT 5
- NETFramework Version=v4.8 Error HOT 5
- .Net Standard Support HOT 4
- Add Download Feature (Winget 1.6.x)
- Add Pin Feature (Winget 1.5.x)
- Why would `GetInstalledPackages` return 2 when `winget show` returns 1? HOT 7
- GetInstalledPackages throws exception if no packages. HOT 3
- Add function to read full winget info
- Hang for `WinGet winget = new WinGet();` HOT 2
- Add Repair Feature (Winget 1.7.10514)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wget.net.