Share via


Export-HpcTask

Exports the settings for a task to an XML file.

Syntax

task (Default)

Export-HpcTask
    -Task <HpcTask>
    -Path <String>
    [-Force]
    [-ClusterConnectionString <String[]>]
    [-Scheduler <String[]>]
    [<CommonParameters>]

id

Export-HpcTask
    -JobId <Int32>
    -TaskId <Int32>
    -Path <String>
    [-Force]
    [-ClusterConnectionString <String[]>]
    [-Scheduler <String[]>]
    [<CommonParameters>]

Description

The Export-HpcTask cmdlet exports the settings for the specified task to a task XML file. You can specify the task for which you want to export the settings by using the job identifier and task identifier for the task or by using an HpcTask object. After you export the task XML file, you can then specify the task XML file in the TaskFile parameter of the Add-HpcTask cmdlet to add a new task to a job with the same settings as the exported task.

Examples

Example 1: Export a task

PS C:\>Export-HpcTask -JobId 1 -TaskId 1 -Path "C:\MyTasks\Task_1_1.xml"

This command exports the settings for the first task in the job with a job ID of 1 to a file at C:\MyTasks\Task_1_1.xml.

Example 2: Get a task object and export its settings

PS C:\>Get-HpcTask -JobId 2 -TaskId 4 | Export-HpcTask -Path "C:\MyTasks\Task_2_4.xml"

This command gets an HpcTask object for the fourth task in the job with a job ID of 2, and then exports the settings for that task to a file at C:\MyTasks\Task_2_4.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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Replaces the task XML file if it already exists, without prompting the user.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobId

Specifies the job identifier of the job that contains the task that you want to export. If you specify the JobID parameter, you must also specify the TaskId parameter. You can use the JobId and TaskId parameters together to specify the job you want to export, or you can use the Task parameter instead, but you cannot combine the Task parameter with the JobId or TaskId parameter.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Path

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

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Scheduler

Specifies the host name or IP address of the head node for the cluster that includes the task. 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\>

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Task

Specifies an HpcTask object that represents the task that you want to export. Use the Get-HpcTask cmdlet to get an HpcTask object for a task. You can use the Task parameter to specify the job you want to export, or you can use a combination of the JobId and TaskId parameters instead, but you cannot combine the Task parameter with the JobId or TaskId parameter.

Parameter properties

Type:HpcTask
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

task
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-TaskId

Specifies the task identifier of the tasks that you want to export. If you specify the TaskId parameter, you must also specify the JobId parameter. You can use the JobId and TaskId parameters together to specify the job you want to export, or you can use the Task parameter instead, but you cannot combine the Task parameter with the JobId or TaskId parameter.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

id
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

HpcTask

Outputs

None