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...
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.
...and? Why is that a problem? It is an advantage that PowerShell can call on the CLR directly (including its C FFI).
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.
Consistency, trust over everything.
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.
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.
Equivalent of "zip": `tar cjf OutputFile.tar.bz2 InputFileOne InputFileTwo InputFileThree`
Equivalent of "unzip": `tar xf InputFile.whatever.extension`
(This works whether `InputFile.whatever.extension` is bzipped, gzipped, or not compressed at all)