Contact Info

Crumbtrail » Administration » Powershell » Powershell 2.0 » Export-PSSession

Export-PSSession - Powershell 2.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Short description
Imports commands from another session and saves them in a Windows PowerShell module.

Export-PSSession [-Session] <PSSession> [-OutputModule] <string> [[-CommandName] <string[]>] [[-FormatTypeName] <st
ring[]>] [-AllowClobber] [-ArgumentList <Object[]>] [-CommandType {Alias | Function | Filter | Cmdlet | ExternalScr
ipt | Application | Script | All}] [-Encoding <string>] [-Force] [-Module <string[]>] [<CommonParameters>]

The Export-PSSession cmdlet gets cmdlets, functions, aliases, and other command types from another PSSession on a l
ocal or remote computer and saves them in a Windows PowerShell module. To add the commands from the module to the c
urrent session, use the Import-Module cmdlet.

Unlike Import-PSSession, which imports commands from another PSSession into the current session, Export-PSSession s
aves the commands in a module. The commands are not imported into the current session.

To export commands, first use the New-PSSession cmdlet to create a PSSession that has the commands that you want to
 export. Then use the Export-PSSession cmdlet to export the commands. By default, Export-PSSession exports all comm
ands, except for commands that exist in the current session, but you can use the CommandName parameters to specify 
the commands to export.

The Export-PSSession cmdlet uses the implicit remoting feature of Windows PowerShell. When you import commands into
 the current session, they run implicitly  in the original session or in a  similar session on the originating comp