5 ms·
>> Powershell solves these problems by having structured data and types and not just streams of bytes Powershell's structured data can cause issues if you expe
by thesuperbigfrog 3y ago
>> Powershell solves these problems by having structured data and types and not just streams of bytes
Powershell's structured data can cause issues if you expect it to be similar to Unix-like shells.
For example, Powershell mangles piped binary data by default:
https://brianreiter.org/2010/01/29/powershells-object-pipeline-corrupts-piped-binary-data/ https://brianreiter.org/2010/01/29/powershells-object-pipeli...
Correct handling of piped binary data requires additional flags:
https://stackoverflow.com/questions/54086430/how-to-pipe-binary-data-in-powershell https://stackoverflow.com/questions/54086430/how-to-pipe-bin...
- Smaug123 3y agoIsn't this exactly what the parent was saying? "Stream of bytes" is not a meaningful thing that Powershell deals with by default. Using an operation like "pipe to file" on a text stream (like the Success output stream) will treat the stream as text, regardless of whether you managed to get raw binary data into the stream. This is kind of the whole point of Powershell: there is no such thing as raw binary data, and you have to work harder if you want to deal with something as bytes. It's certainly a culture shock coming from "everything is a stream of bytes" Unix-land.
- thesuperbigfrog 3y ago>> This is kind of the whole point of Powershell: there is no such thing as raw binary data, and you have to work harder if you want to deal with something as bytes. It's certainly a culture shock coming from "everything is a stream of bytes" Unix-land. Exactly. It means that system administrators need to be aware of the differences when working with Powershell versus other shells to avoid silent corruption of binary data.
- shortrounddev2 3y agoYes, and? A Python developer needs to learn a different language if they become a java developer. A sysadmin needs to learn Windows if they're going to administer Windows.
- thesuperbigfrog 3y ago>> A sysadmin needs to learn Windows if they're going to administer Windows. Powershell is cross-platform and runs on Linux and MacOS as well as Windows: https://github.com/PowerShell/PowerShell https://github.com/PowerShell/PowerShell You can discover differences between Powershell and traditional shells as a Linux admin.
- shortrounddev2 3y agoOk, similarly, you'll need to learn powershell if your going to use it as a tool as a system admin
- shortrounddev2 3y ago> if you expect it to be similar to Unix-like shells And Python can cause issues if you expect it to be similar to Java. They're 2 different tools, so if you expect it to behave similarly to bash, that's on you
- Brian_K_White 3y agoNot if java tried to call itself javashell, but didn't act like a shell.
- Clamchop 3y agoUh, why are sh and derivatives the final word on how a shell must behave? Or at least it appears that you are saying PowerShell doesn't "act like a shell". Is this a No True Scotsman?
- Brian_K_White 3y agoWhy bother have words that mean things then? Call anything you want anything you want. Sounds useful.
- porridgeraisin 3y agoSince when did the definition of a shell include "deals with everything as a unstructured stream of bytes"?