Import-HpcJobTemplate

Imports a job template from an XML file.

Syntax

Import-HpcJobTemplate
      -Name <String>
      -Path <String>
      [-Force]
      [-ClusterConnectionString <String[]>]
      [-Scheduler <String[]>]
      [<CommonParameters>]

Description

The Import-HpcJobTemplate cmdlet imports a job template from an XML file, and as a result creates a new job template or overwrites an existing job template.

Examples

Example 1: Import a job template by name

PS C:\>Import-HpcJobTemplate -Name "MyNewTemplate" -Path "C:\MyTemplates\MyNewTemplate.xml"

This command imports a new job template named MyNewTemplate from the file at C:\MyTemplates\MyNewTemplate.xml.

Example 2: Replace an existing job template

PS C:\>Import-HpcJobTemplate -Name "MyExistingTemplate" -Path "C:\MyTemplates\MyExistingTemplate_revised.xml" -Force

Replaces an existing job template named MyExistingTemplate by importing the new job template settings from the file at C:\MyTemplates\MyExistingTemplate_revised.xml.

Parameters

-ClusterConnectionString

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.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Replaces an existing template without prompting when the value of the Name parameter matches the name of an existing job template.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name for the imported job template. The maximum length of the name is 50 characters. The value can be any alphanumeric string that is less than the maximum length except "default", which is reserved for the default template. The name can include spaces. To specify a name that includes spaces, enclose the name in double quotation marks (").

This name overrides the value that the Name attribute of the JobTemplate element in the XML file specifies, if the names differ.

If this name matches the name of an existing job template and you do not specify the Force parameter, the Import-HpcJobTemplate cmdlet prompts you to confirm whether you want to replace the existing job template.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Path

Specifies the name of the XML file from which to import the job template, including the relative or full path if the file is not in the current directory. The file name and path must be valid.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Scheduler

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\>

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

HpcJobTemplate

Notes

  • If you do not save the HpcJobTemplate object that this cmdlet returns in a variable or redirect the object to another cmdlet, Import-HpcJobTemplate displays information about the job templates. This information includes the name and description for the job template and the dates and times in local time that the job template was created and last changed.

    Job templates are stored centrally on the head node. When you import a new job template, administrators on the head node have full control, modify, and submit jobs permissions on the job template by default. Local users on the head node have submit permissions on the job template. For information about changing permissions on job templates, see the Get-HpcJobTemplateAcl and Set-HpcJobTemplateAcl cmdlets.

    Only administrators on the head node can add new job templates.

  • You must be a cluster administrator to run this cmdlet successfully.