< Back

Get-AzureBatchNodeFile

Tue Jan 29, 2019 9:35 pm

NAME Get-AzureBatchNodeFile



SYNOPSIS

Gets the properties of Batch node files.





SYNTAX

Get-AzureBatchNodeFile [[-ComputeNode] <PSComputeNode>] -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Filter

<String>] [-MaxCount <Int32>] [-Recursive] [<CommonParameters>]



Get-AzureBatchNodeFile [-PoolId] <String> [-ComputeNodeId] <String> [[-Path] <String>] -BatchContext <BatchAccountContext> [-DefaultProfile

<IAzureContextContainer>] [<CommonParameters>]



Get-AzureBatchNodeFile [-PoolId] <String> [-ComputeNodeId] <String> -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>]

[-Filter <String>] [-MaxCount <Int32>] [-Recursive] [<CommonParameters>]



Get-AzureBatchNodeFile -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Filter <String>] -JobId <String>

[-MaxCount <Int32>] [-Recursive] -TaskId <String> [<CommonParameters>]



Get-AzureBatchNodeFile [[-Task] <PSCloudTask>] -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] [-Filter <String>]

[-MaxCount <Int32>] [-Recursive] [<CommonParameters>]



Get-AzureBatchNodeFile [[-Path] <String>] -BatchContext <BatchAccountContext> [-DefaultProfile <IAzureContextContainer>] -JobId <String> -TaskId

<String> [<CommonParameters>]





DESCRIPTION

The Get-AzureBatchNodeFile cmdlet gets the properties of the Azure Batch node files of a task or compute node. To narrow your results, you can

specify an Open Data Protocol (OData) filter. If you specify a task, but not a filter, this cmdlet returns properties for all node files for that

task. If you specify a compute node, but not a filter, this cmdlet returns properties for all node files for that compute node.





PARAMETERS

-BatchContext <BatchAccountContext>

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzureRmBatchAccount

cmdlet to get your BatchAccountContext, then Azure Active Directory authentication will be used when interacting with the Batch service. To

use shared key authentication instead, use the Get-AzureRmBatchAccountKeys 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.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ComputeNode <PSComputeNode>

Specifies the compute node, as a PSComputeNode object, that contains the Batch node files. To obtain a compute node object, use the

Get-AzureBatchComputeNode cmdlet.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-ComputeNodeId <String>

Specifies the ID of the compute node that contains the Batch node files.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Filter <String>

Specifies an OData filter clause. This cmdlet returns properties for node files that match the filter that this parameter specifies.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-JobId <String>

Specifies the ID of the job that contains the target task.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-MaxCount <Int32>

Specifies the maximum number of node files for which this cmdlet returns properties. If you specify a value of zero (0) or less, the cmdlet

does not use an upper limit. The default value is 1000.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Path <String>

Specifies the path of the node file for which this cmdlet retrieves properties. You cannot specify wildcard characters.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PoolId <String>

Specifies the ID of the pool that contains the compute node from which to get properties of node files.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Recursive [<SwitchParameter>]

Indicates that this cmdlet returns a recursive list of files. Otherwise, it returns only the files in the root folder.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Task <PSCloudTask>

Specifies the task, as a PSCloudTask object, with which the node files are associated. To obtain a task object, use the Get-AzureBatchTask

cmdlet.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-TaskId <String>

Specifies the ID of the task for which this cmdlet gets properties of node files.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

BatchAccountContext

Parameter 'BatchContext' accepts value of type 'BatchAccountContext' from the pipeline



PSComputeNode

Parameter 'ComputeNode' accepts value of type 'PSComputeNode' from the pipeline



PSCloudTask

Parameter 'Task' accepts value of type 'PSCloudTask' from the pipeline





OUTPUTS

PSNodeFile







NOTES









Example 1: Get the properties of a node file associated with a task



PS C:\\>Get-AzureBatchNodeFile -JobId "Job-000001" -TaskId "Task26" -Path "Stdout.txt" -BatchContext $Context

IsDirectory Name Properties Url



----------- ---- ---------- ---



False StdOut.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...



This command gets the properties of the StdOut.txt node file associated with the task that has the ID Task26 in the job that has the ID

Job-000001. Use the Get-AzureRmBatchAccountKeys cmdlet to assign a context to the $Context variable.





Example 2: Get the properties of node files associated with a task by using a filter



PS C:\\>Get-AzureBatchNodeFile -JobId "Job-00002" -TaskId "Task26" -Filter "startswith(name,'St')" -BatchContext $Context

IsDirectory Name Properties Url



----------- ---- ---------- ---



False StdErr.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...

False StdOut.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...



This command gets the properties of the node files whose names start with st and are associated with task that has the ID Task26 under job that

has the ID Job-00002.





Example 3: Recursively get the properties of node files associated with a task



PS C:\\>Get-AzureBatchTask "Job-00003" "Task31" -BatchContext $Context | Get-AzureBatchNodeFile -Recursive -BatchContext $Context

IsDirectory Name Properties Url



----------- ---- ---------- ---



False ProcessEnv.cmd Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...

False StdErr.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...

False StdOut.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...

True wd https://cmdletexample.westus.Batch.contoso...

False wd\\newFile.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...



This command gets the properties of all files associated with the task that has the ID Task31 in job Job-00003. This command specifies the

Recursive parameter. Therefore, the cmdlet performs a recursive file search is performed, and returns the wd\\newFile.txt node file.





Example 4: Get a single file from a compute node



PS C:\\>Get-AzureBatchNodeFile -PoolId "Pool22" -ComputeNodeId "ComputeNode01" -Path "Startup\\StdOut.txt" -BatchContext $Context

IsDirectory Name Properties Url

----------- ---- ---------- ---

False startup\\stdout.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...



This command gets the file that is named Startup\\StdOut.txt from the compute node that has the ID ComputeNode01 in the pool that has the ID Pool22.





Example 5: Get all files under a folder from a compute node



PS C:\\>Get-AzureBatchNodeFile -PoolId "Pool22" -ComputeNodeId "ComputeNode01" -Filter "startswith(name,'startup')" -Recursive -BatchContext

$Context

IsDirectory Name Properties Url

----------- ---- ---------- ---

True startup https://cmdletexample.westus.Batch.contoso...

False startup\\ProcessEnv.cmd Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...

False startup\\stderr.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...

False startup\\stdout.txt Microsoft.Azure.Commands.Batch.Models.PSFile... https://cmdletexample.westus.Batch.contoso...

True startup\\wd https://cmdletexample.westus.Batch.contoso...



This command gets all the files under the startup folder from the compute node that has the ID ComputeNode01 in the pool that has the ID Pool22.

This cmdlet specifies the Recursive parameter.





Example 6: Get files from the root folder of a compute node



PS C:\\>Get-AzureBatchComputeNode "Pool22" -Id "ComputeNode01" -BatchContext $Context | Get-AzureBatchNodeFile -BatchContext $Context

IsDirectory Name Properties Url

----------- ---- ---------- ---

True shared https://cmdletexample.westus.Batch.contoso...

True startup https://cmdletexample.westus.Batch.contoso...

True workitems https://cmdletexample.westus.Batch.contoso...



This command gets all the files at the root folder of the compute node that has the ID ComputeNode01 in the pool that has the ID Pool22.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... chnodefile

Get-AzureRmBatchAccountKeys

Get-AzureBatchComputeNode

Get-AzureBatchNodeFileContent

Get-AzureBatchTask

Azure Batch Cmdlets