Instead you just have to google how to use `tar` properly. Again.
You can tab complete powershell cmdlet switches. And MSDN has extensive and good documentation. Here's the page for Invoke-WebRequest. Notice the very first switch listed. Further note that Microsoft realized they screwed this up and deprecated the switch in PS 6.0 since it is now the default.
No googling because it hasn't changed in the last 20 years.
How do you unzip a 20 gig file in powershell?
1. You can use the windows shell via complicated series of calls. This runs like ass as the windows built in decompression is terrible. Also it only works properly if there's a desktop session running so over WinRM it does with a COM error.
2. Find out which version of powershell you have, hope it's 5.0 or later or install the right WMF version and then run expand-archive. And it still runs like ass. But oh no we can't because now we have to push WMF 5.0 to 150 servers which is going to take DAYS with SCCM. Some kit is on Windows 2012, some on 2012 R2 and some on 2016 because it's so damn hard migrating stuff as it has to be done by hand so you have a mix of stuff leading to a nightmare from hell.
3. Import System.IO.Compression and call .Net to do it then wrap it in a cmdlet called Expand-Archive, then wonder why it breaks when someone pushes out WMF 5.0+
4. Push 7za.exe out with ansible and run that.
This is the problem. No good outcome for really simple tasks. Friction for all of them.
Edit: I'm being 100% honest here and say I hate it with such a passion because I've lived in the same building as it for several years, not because I'm not aware of how it works.
Exception calling "ExtractToDirectory" with "2" argument(s): "End of Central Directory record could not be found."
7zip works fine!
(copied straight from my MASSIVE OneNote book of weird powershell and .Net errors and workarounds). Also they just deprecated OneNote desktop other than the turdy UWP app. Another thing to be angry about.
But you're completely willing to forgive UNIX's toolset's problems because you're used to them after working with them for decades. I get it, but that does not make them better.
"properly" in this context meaning "the way I am used to, warts and all", right? Because otherwise I can't see why you'd be so upset about Invoke-WebRequest doing exactly what it was designed and documented to do.
Consistency? In UNIX tools? No. What you have is familiarity. Don't get me wrong, there's a lot to be said for working with tools you're familiar with, but again that doesn't mean they are actually objectively better tools.
Consistently as in it stays doing the intended job in as an idempotent manor as possible.
Whether or not it’s ugly or elegant don’t matter if it doesn’t work or stay working.
You can argue semantics but this is a turd that can’t be glittered.
Another way to look at powershell is that the idea is good but the implementation isn’t. Unix style shells the implementation is excellent but the idea is mediocre. All productivity and therefore business value is really tied to the implementation quality.
> Another way to look at powershell is that the idea is good but the implementation isn’t.
I wouldn't entirely disagree with that statement.
> Unix style shells the implementation is excellent but the idea is mediocre.
This I would. The idea was a really good one... in the 70s. It has utterly failed to evolve since then. The implementation is actually pretty horrible. If you don't have a lot of familiarity with it it is undiscoverable, full of footguns, and consistency is an afterthought.
You learn to really appreciate POSIX implementations when you do things like grep and pipe results over 100GB+ text files. and no, these text files were not created due to unix philosophy, I’m talking about xml generated in Java as an example. grep&co are a godsend trying to tackle these without ripping out every hair on your body.
forget about it *nix has won. No matter hiw bad some of it's design might have been. The was some nix fanatics act makes me worry about open source in general
You can tab complete powershell cmdlet switches. And MSDN has extensive and good documentation. Here's the page for Invoke-WebRequest. Notice the very first switch listed. Further note that Microsoft realized they screwed this up and deprecated the switch in PS 6.0 since it is now the default.
https://docs.microsoft.com/en-us/powershell/module/microsoft...