Remove-HpcJobTemplate

Deletes a job template.

Syntax

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

Description

The Remove-HpcJobTemplate cmdlet deletes a job template from the specified cluster. You can specify the job template that you want to delete either by name or by passing an HpcJobTemplate object to the Remove-JobTemplate cmdlet.

Examples

Example 1: Remove a template

PS C:\>Remove-HpcJobTemplate -Name "Template 2"

This command deletes the job template named Template 2.

Example 2: Get a template and then remove it

PS C:\>Get-HpcJobTemplate -Name "MyExtraTemplate" | Remove-HpcJobTemplate

This command gets the HpcJobTemplate object for a job template called MyExtraTemplate, and then deletes that job template by redirecting the object to the Remove-HpcJobTemplate cmdlet.

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 template that you want to delete. You cannot specify both the Name and Template parameters. The maximum length of the name of the job template is 50 characters.

Type:String
Position:1
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 the HpcJobTemplate object for the job template you want to delete. You cannot specify both the Name and Template parameters. Use the Get-HpcJobTemplate cmdlet to get an HpcJobTemplate object for the job template.

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

Inputs

HpcJobTemplate

Outputs

None

Notes

  • You cannot delete the default job template. Only cluster administrators can delete job templates. If a job in the queued or running state uses the template, an error occurs and the cmdlet does not delete the template.
  • You must be a cluster administrator to run this cmdlet successfully.