5 ms·
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 ser
by setquk 8y ago
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.
- AnIdiotOnTheNet 8y ago> Import System.IO.Compression and call .Net to do it. ...and? Why is that a problem? It is an advantage that PowerShell can call on the CLR directly (including its C FFI).
- setquk 8y agoBecause half the time it slings 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.
- AnIdiotOnTheNet 8y agoBut 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.
- setquk 8y agoWorking properly == better in my mind. Consistency, trust over everything.
- AnIdiotOnTheNet 8y ago"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.
- setquk 8y agoProperly as in it does the intended job. 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.
- AnIdiotOnTheNet 8y ago> 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.