>>990715
When you're piping shell processes which output text to the terminal, you'll often need to filter out unneeded text or use regexp groups to extract the bits you want before passing them to the next pipe. When your shell is piping objects instead of text, you can use property accessors and WHERE clauses to filter the data.
For example, if you wanted to change the CPU allocation of every currently running virtual machine on a Windows hypervisor, you could do it in a single line in Powershell:
Get-VM | Where { $_.State –eq ‘Running’ } | Stop-VM -Force -Passthru | Set-VM -ProcessorCount 4 -Passthru | Start-VM
To do the same thing in Linux with a text-based shell, you'd have to list the VM table (using virsh, qm, or some other VM manager), filter the rows which don't contain RUNNING in the status column using awk or sed, parse those lines for the Virtual Machine IDs, run the virtual machine manager again for each ID to stop them from running, run the virtual machine manager again for each ID to set the CPU count, and run the virtual machine manager yes again for each ID to start them back up.
On my Linux hypervisor, my script which automates these tasks (and uses proper BASH data structures to keep it as D.R.Y. as possible) is about 100 lines of painstakingly well-tested code. I would've saved many hours if Powershell were an option.