2
votes

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

1
With local runspaces, you can create a bunch and use them to connect to different remote machines at later time. Remote runspaces are however tied to specific machines - Madhulika

1 Answers

2
votes

With local runspaces, you can create a bunch and use them to connect to different remote machines at later time. Remote runspaces are however tied to specific machines