Edit

Share via


Remove-AzBatchNodeFile

Deletes a node file for a task or compute node.

Syntax

Task

Remove-AzBatchNodeFile
    -JobId <String>
    -TaskId <String>
    -Path <String>
    -BatchContext <BatchAccountContext>
    [-Force]
    [-Recursive]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ComputeNode

Remove-AzBatchNodeFile
    [-PoolId] <String>
    [-ComputeNodeId] <String>
    -Path <String>
    -BatchContext <BatchAccountContext>
    [-Force]
    [-Recursive]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

InputObject

Remove-AzBatchNodeFile
    [[-InputObject] <PSNodeFile>]
    -BatchContext <BatchAccountContext>
    [-Force]
    [-Recursive]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-AzBatchNodeFile cmdlet deletes an Azure Batch node file for a task or compute node.

Examples

Example 1: Delete a file associated with a task

Remove-AzBatchNodeFile -JobId "Job-000001" -TaskId "Task26" -Path "wd\testFile.txt" -BatchContext $Context

This command deletes the node file that is named wd\testFile.txt. That file is associated with the task that has the ID Task26 under the job Job-000001.

Example 2: Delete a file from a compute node

Remove-AzBatchNodeFile -PoolId "Pool07" -ComputeNodeId "tvm-2316545714_1-20150725t213220z" -Path "startup\testFile.txt" -BatchContext $Context

This command deletes the node file that is named startup\testFile.txt from the specified compute node in the pool that has the ID Pool07.

Example 3: Remove a file by using the pipeline

Get-AzBatchNodeFile -JobId "Job-000001" -TaskId "Task26" -Path "wd\testFile2.txt" -BatchContext $Context | Remove-AzBatchNodeFile -Force -BatchContext $Context

This command gets the node file by using Get-AzBatchNodeFile. That file is associated with the task that has the ID Task26 under the job Job-000001. The command passes that file to the current cmdlet by using the pipeline. The current cmdlet removes the node file. The command specifies the Force parameter. Therefore, the command does not prompt you for confirmation.

Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzBatchAccount cmdlet to get your BatchAccountContext, then Microsoft Entra authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzBatchAccountKey cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.

Parameter properties

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

Parameter sets

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

-ComputeNodeId

Specifies the ID of the compute node that contains the Batch node file that this cmdlet deletes.

Parameter properties

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

Parameter sets

ComputeNode
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

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

-Force

Forces the command to run without asking for user confirmation.

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

-InputObject

Specifies PSNodeFile object that represent the node file that this cmdlet deletes. To obtain a PSNodeFile, use the Get-AzBatchNodeFile cmdlet.

Parameter properties

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

Parameter sets

InputObject
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-JobId

Specifies the ID of the job that contains the task.

Parameter properties

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

Parameter sets

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

-Path

The file path of the node file to delete.

Parameter properties

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

Parameter sets

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

-PoolId

Specifies the ID of the pool that contains the compute nodes for which this cmdlet removes a file.

Parameter properties

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

Parameter sets

ComputeNode
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Recursive

Indicates that this cmdlet deletes the folder and all subfolders and files under the specified path. This cmdlet is relevant only if the path is a folder.

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

-TaskId

Specifies the ID of the task.

Parameter properties

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

Parameter sets

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
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

String

PSNodeFile

BatchAccountContext

Outputs

Void