I have a large script that remotes to several servers and performs various tasks, most of the code is stored in sub files inside script blocks and dot sourced. Depending on the task called, the various script blocks are added together and sent on to the remote servers and the task is ran on the remote end.
Its become long and unruly so I wanted to break out the code into modules and separate cmdlets. I need to remain compatible to Powershell 2, so I am unclear on how to provide the shared functions contained in a module on the remote end.
Its trivial to do the reverse, but I will be accessing several servers and can not pre-install the modules.
Any idea on how to handle this refactoring?
Thanks!