New-SmaPortableModule

Applies To: System Center 2012 R2 Orchestrator, Windows Azure Pack for Windows Server

New-SmaPortableModule

Creates a Service Management Automation portable module from a Windows Powershell module.

Syntax

New-SmaPortableModule -Session <PSSession> -ModuleName <String> [-OutputPath <String>] [-IsSnapIn]

Detailed Description

The New-SmaPortableModule function converts a Windows PowerShell module that is not easily imported into Service Management Automation into a representation of the module that can be imported into Service Management Automation. This type of module may be one with dependencies on external files or registry settings on the computer where the Windows PowerShell module is installed.

A portable module contains all of the cmdlets from the original module, but does not retain the functionality of the cmdlets from the original module. Therefore, portable modules are useful within Service Management Automation as a means for activity discovery.

If you want to use the original functionality of a cmdlet in a portable module, the cmdlet must be run in an InlineScript against a host that has the original Windows PowerShell module installed. However, if all runbook worker hosts have the original Windows PowerShell module installed, you do not need to run the cmdlet from an InlineScript.

Parameters

Session

Specifies the Windows PowerShell session that contains the Windows PowerShell module to convert into a portable module. To create a PSSession object, use the New-PSSession cmdlet. To get a PSSession object, use the Get-PSSession cmdlet.

ModuleName

Specifies the name of the Windows PowerShell module to convert into a portable module.

OutputPath

Specifies the location to store the portable module on the local computer. The default location is the current directory.

IsSnapin

Indicates that the Windows PowerShell module is a snap-in rather than a module.

Examples

Example 1: Create a portable module

This command creates a portable module from the Windows PowerShell module named PSModule01 and stores it in C:\Modules\PortableModules.

New-SmaPortableModule -Session (New-PSSession)  -ModuleName "PSModule01" -OutputPath "C:\Modules\PortableModules"