Problem: When I use a script to run another script remotely that relies on a module, the module is not imported.
I have 3 scripts that interact with each other. A Controller
script, Body
script, and Functions
module.
The Controller
is handling the authentication to the remote computer and executing the body
script on the remote computer using the Invoke-Command
.
The body
is relying on the functions
module.
Edit: I'm almost positive that it's because it's trying to find the module path on the remote computer and the path is referencing a location on the host computer. Aside from using an invoke-command
from the remote computer back to the host to import the module, I'm not sure how to accomplish this.
Why not import the module using the network path in your code? If you know where the module is going to be, you can provide the path to it, even if it's on a remote machine