Are you a developer that sometimes builds command line tools? You should consider creating a #powershell module instead. You get command and parameter auto complete without building anything.
https://svrooij.io/2024/01/18/dependencies-powershell-module-csharp/
#mvpbuzz #development #dotnet
Using dependency injection in your C# PowerShell Modules

Using dependency injection in your C# PowerShell module and run your async code like you're used to.

@svrooij This!!! 💯 ⬆️
@sassdawe feedback like this is what everybody could use!
Spread the positivity
@svrooij I had a project once where we needed to create a tool, the #dotnet developer almost started to write it as a standard CLI tool when I showed him a sample project of a #PowerShell #cmdlet  with all the built in pluming for input and output handling. I think it was love at first sight for them 
@sassdawe @svrooij if only I had been able to persuade the winget team that #powershell was the right answer. Sadly I did not succeed.
@DoctorDNS @sassdawe maybe there is an implementation in the making….. 🤐 https://github.com/svrooij/WingetIntune/tree/feature/ps-module
Winget is all open-source… It depends on what you want to do, but if I can generate the same installer commands, you should be able to create a C# or even pure PowerShell module that does the same as winget.
GitHub - svrooij/WingetIntune at feature/ps-module

Package any app from Winget to Intune - WinTuner. Contribute to svrooij/WingetIntune development by creating an account on GitHub.

GitHub
@svrooij @sassdawe widget is, iirc, all C++ so it would be a total rewrite.
@DoctorDNS @svrooij @sassdawe not a _total_ rewrite, I mean, C++/CLI is a thing.
@jaykul @svrooij @sassdawe but how much C++ code could be converted into c#? But it won't happen.
@DoctorDNS @jaykul @sassdawe I'm saying that I already have like 70% of the functionality in my C# project. They should have built it in C# in the first place... But since that is not the case you can rebuild it in C#. I'm using the Winget repository for something else.
It all comes down to getting the right installer, validating the hash and starting it with the right parameters (which are hidden in the code and sometimes are in the manifest)

@DoctorDNS @svrooij @sassdawe but why would *they* want to write a tool in .NET?

This is the team that -- HERE, in the 212st Century -- ignored WPF and Silverlight and rewrote XAML from scratch in C/C++ to make WinUI, a Windows-only app framework that "decouples" WinRT Xaml from the operating system -- without actually making it work in any other operating system.

@jaykul @svrooij @sassdawe needless to say, the current team management will not fix the problem. Still, 3 years in and the product is still in beta and still unsupported. I just think about what could have been.
@DoctorDNS @svrooij @sassdawe I'm still using Chocolatey.
@jaykul @svrooij @sassdawe me too. I can't help thinking msft could have bought chocolatey for less than they spent on widget.
@DoctorDNS @svrooij @sassdawe LOL, I hope you're over-estimating how much effort has been paid for on WinGet.
@jaykul @DoctorDNS @sassdawe i'm not going to convince you guys... Just saying that installing apps when everybody sends you the details of the installer is not that complex.
Building something like this in c++ might be the biggest issue
@svrooij @jaykul @sassdawe winget was a badly scoped project. IMHO. It could have been something great.
@DoctorDNS @svrooij @jaykul IMO #winget is good enough for the everyday nerd, but.. there is no but. For more advanced cases, and enterprise use.. it can't really be an alternative to #chocolatey
@sassdawe @DoctorDNS @svrooij have you ever dared to run "winget upgrade * -all" ?
@jaykul @sassdawe @svrooij haven't installed winget.

@DoctorDNS @jaykul @svrooij I did and learned that if I do that without using my Admin account I won't be happy.

It was able to remove stuff but never installed the newer version, so I had to figure out what was missing and install them again.

Fun stuff.

@sassdawe @jaykul @svrooij I found it odd it could update things it hasn't explicitly installed. Dangerous, I feels but it is by design.
@DoctorDNS @sassdawe @svrooij that's ... one of the reasons I don't use it...

@jaykul
@sassdawe @DoctorDNS @svrooij

I used to do it all the time until one of my apps had a breaking update and I had to stop updating it. Now, I do them manually with winget.

@jamie @sassdawe @DoctorDNS @svrooij yeah, Winget seems to just assume it owns everything on the computer.

I do "upgrade all" with chocolatey regularly, but chocolatey doesn't try to upgrade anything I didn't install with it, plus it has a way to "pin" the version of things I need to keep on a specific version for whatever reason (like keeping PowerShell on LTS instead of latest, so it's the same as my build agents).

@jaykul
@sassdawe @DoctorDNS

If winget had PIN, i'd be golden. I'm fine with it recognizing stuff it didn't install and managing it.

I do wish it didn't show stuff it can't manage ("looks like this was installed with a different technology...")