Invoke-WebRequest most certainly runs on linux.
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!