5 ms·
PowerShell runs on Linux. I run PS as my primary shell [0] on Linux today. It's is open source too. You're not far away with how PowerShell can parse Linux com
by electricEmu 6y ago
PowerShell runs on Linux. I run PS as my primary shell [0] on Linux today. It's is open source too.
You're not far away with how PowerShell can parse Linux commands. Instead of relying on awk/grep, PowerShell uses .NET under the hood to provide consistency across operating systems. There are a few methods for converting from a Linux command to PowerShell objects based on delimiters or OFS. If you're interested, Steve Lee wrote a blog post that does a good job covering how to parse Linux command output into PowerShell objects [1].
[0] https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1 https://docs.microsoft.com/en-us/powershell/scripting/instal...
[1] https://devblogs.microsoft.com/powershell/parsing-text-with-powershell-1-3/ https://devblogs.microsoft.com/powershell/parsing-text-with-...
- kaba0 6y agoYeah, I know about it running on linux and even tried to use it as a default shell for a time. Thanks for the links though, I didn’t dive this deep into it.