Run a local function on a remote computer?

Question:

I have a simple function on my computer

I would like to run it on a remote computer

Understandably, Do-Stuff does not exist on OTHERPC and this does not work. How could I get it to work though? The Do-Stuff function abstracts some basic code and is invoked in a few other places so I don’t want to duplicate it.

Notice that in my example values are passed into the function both via a parameter and via scope closure. Is that possible?

Answer:

I don’t know how you use the closure value, but you can pass both as parameters like so:

Source:

Run a local function on a remote computer? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply