I would not invite it onto a *nix machine voluntarily where there are established patterns and solutions which have matured over the space of 40 odd years now.
In my experience with PowerShell on Windows, you have to approach it more like interactive python with shortcuts rather than a regular shell, and once you’re accustomed it works fine. The main issue is that it doesn’t work like a classic shell, it just has some affordances to look like a classic shell in common use cases.
It really feels immature.
The biggest travesty is when it is integrated into something else such as ansible, packer, chocolatey etc where it will cost you a couple of days occasionally due to some obscure issue hidden behind even more layers.
If you want to do anything that would be windows only then you're right, it probably won't work.
That said, I usually have a tmux window ssh'd into a windows machine for powershell. It would be nice to be able to manage ad and exchange from a linux machine with powershell.
Being able to do simple web scraping like this in a "shell" is pretty great:
$hn = Invoke-WebRequest https://news.ycombinator.com/
$hn.AllElements | Where {$_.TagName -eq "a" } | Where { $_.Class -eq "StoryLink" } | select "innerHtml"How does Invoke-WebRequest decide if it’s looking at HTML or something else?
Or decide yourself for Invoke-WebRequest to pipe it with whatever the data: ConvertFrom-{JSON,XML,CSV}
With Invoke-WebRequest you get back headers, raw response, etc - and you get to decide whats next. With the RestMethod - just the content as an object.
So is creating secure strings.
Cool!
Powershell is a nice idea, but Microsoft is kidding themselves if they think it's even close to the alternatives.
I tried running powershell on linux a few times, and every single time the second command I run is not supported on linux.
I don't even remember what the commands were, PSremoting was one for sure and I think another was Invoke-WebRequest.
Powershell on linux is a nice idea but in the current form it is in name only, as nearly nothing works.