I need to run commands remotely on a different machine programmatically and am using powershell (from c#) for it. I would like to know the pros and cons of using
- remote runspace and running the commnds using the powershell pipeline vs
- local runspace and using new-pssession, invoke-command to create session to the remote machine and invoke commands.
Let us say I am not interested in the fan-out capabilities for now.
Also, how does this change as I have more machines I want to execute different commands on.
Thanks