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
I would suggest something like:
$rs = New-PSSession -ComputerName "RemoteComputer" Invoke-Command -Session $rs -scriptblock {import-module ActiveDirectory} Import-PSSession -Session $rs -Module ActiveDirectory
Since then, you can use ActiveDirectory cmdlets in your session.
Hope this helps.