Export-HpcJobTemplate

Export-HpcJobTemplate

Exports a job template to an XML file.

Syntax

Parameter Set: profile
Export-HpcJobTemplate -Path <String> -Template <HpcJobTemplate> [-ClusterConnectionString <String[]> ] [-Force] [-Scheduler <String[]> ] [ <CommonParameters>]

Parameter Set: name
Export-HpcJobTemplate [-Name] <String> -Path <String> [-ClusterConnectionString <String[]> ] [-Force] [-Scheduler <String[]> ] [ <CommonParameters>]




Detailed Description

The Export-HpcJobTemplate cmdlet exports the specified job template to an XML file. You can specify the job template by name or as an HpcJobTemplate object. You can edit the XML file to change settings as needed, and then import it to create a new job template based on the exported job template.

Parameters

-ClusterConnectionString<String[]>

Specifies an array of cluster connection strings for the cluster to which you want to add the device drivers. The value format is host1,host2,host3. If you do not specify the ClusterConnectionString parameter, this cmdlet uses the connection string on the head node that the CCP_CONNECTIONSTRING environment variable specifies. To set this environment variable, run the following cmdlet: Set-Content Env: CCP_CONNECTIONSTRING <head_node_name>.

This parameter was introduced in HPC Pack 2016.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Indicates that this operation overwrites the specified XML file without prompting if it already exists.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of the job template that you want to export. The maximum length of the name is 50 characters. You cannot specify both the Name and Template parameters.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Path<String>

Specifies a name for the XML file to which you want to export the job template, including the full or relative path to the file if the Export-HpcJobTemplate cmdlet should not save the file in the current directory.

This cmdlet creates any directories that do not already exist in the path. If the file already exists and you do not specify the Force parameter, the cmdlet prompts you to confirm whether you want to replace the file.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Scheduler<String[]>

Specifies the host name or IP address of the head node for the cluster that includes the job templates. The value must be a valid computer name or IP address. If you do not specify the Scheduler parameter, this cmdlet uses the scheduler on the head node that the CCP_SCHEDULER environment variable specifies. To set this environment variable, run the following cmdlet:

Set-Content Env:CCP_SCHEDULER <head_node_name>


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Template<HpcJobTemplate>

Specifies the HpcJobTemplate object for the job template that you want to export. You cannot specify both the Name and Template parameters. Use the Get-HpcJobTemplate cmdlet to get an HpcJobTemplate object for the job template.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • HpcJobTemplate

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

Examples

Example 1: Export a job template

This command exports the job template named My Template to a file named My Template.xml.


PS C:\> Export-HpcJobTemplate -Name "My Template" -Path "My Template.xml"

Example 2: Get a job template and export it

This command gets the HpcJobTemplate object for a job template named MyTemplate, and then exports that job template to the MyTemplate.xml file by specifying that HpcJobTemplate object.


PS C:\> $MyTemplate = Get-HpcJobTemplate -Name "MyTemplate"
PS C:\> Export-HpcJobTemplate -Template $MyTemplate -Path "MyTemplate.xml"

Example 3: Pass a job template and export it

This command gets the HpcJobTemplate object for a job template named MyTemplate, and then exports that job template to the MyTemplate.xml file by redirecting the object to the Export-HpcJobTemplate cmdlet.


PS C:\> Get-HpcJobTemplate -Name MyTemplate | Export-HpcJobTemplate -Path "MyTemplate.xml"

Related topics

Community Additions

ADD
Show: