How to run scripts on remote servers


In my mind, it was working so easy to setup Powershell Universal, for automation, script and API’s to my managed devices. So my first script I wanted to make is a “Hyper-V Replication repair” tool, so can fix Hyper-V replication automatic.

So far so good, I started creating the script and thats all done now. But now I’m on a part, where I don’t really thinked about before. Because in my idea, that was already covered… (maybe it is, and I can’t find it or don’t get it)

I want to run that script on different servers, inside and outside my network. How do I run scripts on remote servers that are not connected to my environment.

Is there a way to connect to them, secure and run the script?
Or can the client server get the script from Universal Server and run it?

Please let me know, searched the forum about it, and also the documentation. So I was thinking maybe have a quick answer.

Kind regards,