Hello PS Gurus,
I would like a way to accomplish what the following command does, but on a remote computer assuming that remote computer has PSRemoting disabled and running powershell v2 and .Net 4.0. (or higher).
That’s like saying you wanna drive someplace but don’t want to use a car :). That’s the command I would use; it’s ugly because psexec is having to deal with formatted output that wasn’t meant to be handled that way.
But yeah, it’s a string. That’s all psexec can do.
Apart from just directly using what Invoke-WebRequest is using under the hood, I don’t know what else you’d do. That’s how .NET does web queries.
I mean, you could check the status code of the response to see if it’s 200 or an error, and output something, I guess. But you’re using 21st century technology in a 20th century context. It’s gonna be ugly.