Copy-HpcJobTemplate

Copies a job template.

Syntax

Copy-HpcJobTemplate
    -NewName <String>
    -Template <HpcJobTemplate>
    [-ClusterConnectionString <String[]>]
    [-Scheduler <String[]>]
    [<CommonParameters>]
Copy-HpcJobTemplate
    [-Name] <String>
    -NewName <String>
    [-ClusterConnectionString <String[]>]
    [-Scheduler <String[]>]
    [<CommonParameters>]

Description

The Copy-HpcJobTemplate cmdlet creates a job template by copying an existing job template. You can use the name of the existing job template or use an HpcJobTemplate object to specify the job template that you want to copy.

Examples

Example 1: Copy a template

PS C:\>Copy-HpcJobTemplate -Name "OriginalTemplate" -NewName "NewTemplate"

This command creates a job template named NewTemplate by copying the existing OriginalTemplate job template.

Example 2: Get the default job template and copy it

PS C:\>Get-HpcJobTemplate -Name Default | Copy-HpcJobTemplate -NewName "NewTemplate2"

This command gets an HpcJobTemplate object for the Default job template, and then redirects that object to the Copy-HpcJobTemplate cmdlet to create a new job template called NewTemplate2 by copying the Default job template.

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

-Name

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

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

-NewName

Specifies the name to use for the new job template. The maximum length for the name is 50 characters. The name 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 (").

You cannot use the Copy-HpcJobTemplate cmdlet to overwrite an existing job template, so an error occurs if you specify the name of an existing job template for the NewName parameter.

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

-Template

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

This parameter was introduced in Windows HPC Server 2008 R2 and is not supported in previous versions.

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

Inputs

HpcJobTemplate

Outputs

None

Notes

  • To view the names of existing job templates that you might want to copy, run the Get-HpcJobTemplate cmdlet without specifying a value for the Name parameter.
  • Only administrators on the head node can create new job templates.
  • You must be a cluster administrator to run this cmdlet successfully.