Powershell Remoting: using imported module cmdlets in a remote pssession

前端 未结 7 2125
我在风中等你
我在风中等你 2021-02-05 12:34

Is there a way to use modules that were imported in a local session in a remote session? I looked at import-pssession, but I don\'t know how to get the local session. Here\'s a

7条回答
  •  时光取名叫无心
    2021-02-05 12:49

    I don't believe you can. You can go the other way - import commands loaded on the remote machine into your remote session running on the local machine. You can specify a script to invoke-command and it will copy that script over to the remote machine and run it. But if you require snapins or additional modules, you will need to make sure those are installed on each remote machine and then load them into the remote session via commands or your script.

提交回复
热议问题