I\'m developing a custom PowerShell module, which I\'d like to use in context of a remote session to a different computer. The following code (which obviously doesn\'t work)
What about making scriptblock out of your custom function and sending it off to terget servers using Invoke-command
Invoke-command
Import-module YourModule $s = [scriptblock]::Create($(get-item Function:\Your-ModuleFunction).Definition) Invoke-Command -ScriptBlock $s -Computername s1,s2,sn