I have a Linux box running Ubuntu Server 16.04 with Powershell on it, from the Linux terminal if I run:
sudo powershell (Invoke-Webrequest http://ipinfo.io/json | ConvertFrom-Json).ip
I get an error saying it is formatted incorrectly and expected a ')' at the end. if I remove the () and just try to convert from JSON it throws a could not find the command ConvertFrom-Json.
That said if I actually go into powershell and run the original command it works perfectly.
Any help would be greatly appreciated.