Passing strings to string functions

Is there a way, (not on windows) to call powershell from bash or what have you and just pass it a text string that would then be fed to something like toUpper()?

I’ve been rather unsuccessful at figuring this out on my own.

Yes and like this

pwsh -c "(Get-Process)[0].ToString()"

pwsh -help