Yes, it is faster, but I would like a better implementation, that’s just super ugly and it bothers me I can’t figure out how to make it better and simple.
I tell you that it works and you say its too ugly? You failed to define what you consider too slow, then you state you only want to use (New-Object System.Net.WebClient).DownloadFile which i originally stated works… I’m super confused.
Do you want to use it or not want to use it? You are giving conflicting information.
If you want it to be more ‘simple’ write a wrapper function then call your wrapper function. but tbh, it’s pretty simple as is IMO, it’s a single method that takes two parameters.
What I would like to do is create a powershell script that downloads the latest (non-beta) version of qBittorrent from sourceforge.
Which is another thing - I have to make sure it doesn’t catch the beta versions.
Just to be clear, we’re here to help with scripts, not write them for others. If you’re looking for someone to write you a script, you’ll want to engage with fiver or another paid service.
That said, this is mostly straight forward with a wrapper command, as previously mentioned.
This is something I wrote in like 5-6 seconds. Then you can call Get-BitTorrent, and if you don’t provide any parameters, it’ll use the default parameters… Note that for each session you need to ‘load’ that function in your session, so it’s probably best to add it to your PS Profile. See: about Profiles - PowerShell | Microsoft Learn
If you don’t want to catch the beta versions, you’ll want to try to code that in. I don’t have any knowledge on how their releases are done, and whether they use different sources for different things.
while the free version is community driven, they probably keep that up to date : Chocolatey Software | qBittorrent 4.6.4. It has the added benefit of installing it in the same step, and you can easily update.