< Back
Get-AzureBatchNodeFileContent
Post
NAME Get-AzureBatchNodeFileContent
SYNOPSIS
Gets a Batch node file.
SYNTAX
Get-AzureBatchNodeFileContent [-PoolId] <String> [-ComputeNodeId] <String> [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd
<Int64>] [-ByteRangeStart <Int64>] [-DefaultProfile <IAzureContextContainer>] -DestinationPath <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [-PoolId] <String> [-ComputeNodeId] <String> [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd
<Int64>] [-ByteRangeStart <Int64>] [-DefaultProfile <IAzureContextContainer>] -DestinationStream <Stream> [<CommonParameters>]
Get-AzureBatchNodeFileContent [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationPath <String> -JobId <String> -TaskId <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [[-InputObject] <PSNodeFile>] -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationPath <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationStream <Stream> -JobId <String> -TaskId <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [[-InputObject] <PSNodeFile>] -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationStream <Stream> [<CommonParameters>]
DESCRIPTION
The Get-AzureBatchNodeFileContent cmdlet gets an Azure Batch node file and saves it as a file or to a stream.
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
-ByteRangeEnd <Int64>
The end of the byte range to be downloaded.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ByteRangeStart <Int64>
The start of the byte range to be downloaded.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ComputeNodeId <String>
Specifies the ID of the compute node that contains the node file that this cmdlet returns.
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
-DestinationPath <String>
Specifies the file path where this cmdlet saves the node file.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DestinationStream <Stream>
Specifies the stream into which this cmdlet writes the node file contents. This cmdlet does not close or rewind this stream.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-InputObject <PSNodeFile>
Specifies the file that this cmdlet gets, as a PSNodeFile object. To obtain a node file object, use the Get-AzureBatchNodeFile cmdlet.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByValue)
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
-Path <String>
The path of the node file to download.
Required? true
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 that contains the node file that this cmdlet gets.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TaskId <String>
Specifies the ID of the task.
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
PSNodeFile
Parameter 'InputObject' accepts value of type 'PSNodeFile' from the pipeline
OUTPUTS
NOTES
Example 1: Get a Batch node file associated with a task and save the file
PS C:\\>Get-AzureBatchNodeFileContent -JobId "Job01" -TaskId "Task01" -Path "StdOut.txt" -DestinationPath "E:\\PowerShell\\StdOut.txt" -BatchContext
$Context
This command gets the node file that is named StdOut.txt, and saves it to the E:\\PowerShell\\StdOut.txt file path on the local computer. The
StdOut.txt node file is associated with task that has the ID Task01 for the job that has the ID Job01. Use the Get-AzureRmBatchAccountKeys cmdlet
to assign a context to the $Context variable.
Example 2: Get a Batch node file and save it to a specified file path using the pipeline
PS C:\\>Get-AzureBatchNodeFile -JobId "Job02" -TaskId "Task02" -Path "StdErr.txt" -BatchContext $Context | Get-AzureBatchNodeFileContent
-DestinationPath "E:\\PowerShell\\StdOut.txt" -BatchContext $Context
This command gets the node file that is named StdErr.txt by using the Get-AzureBatchNodeFile cmdlet. The command passes that file to the current
cmdlet by using the pipeline operator. The current cmdlet saves that file to the E:\\PowerShell\\StdOut.txt file path on the local computer. The
StdOut.txt node file is associated with the task that has the ID Task02 for the job that has the ID Job02.
Example 3: Get a Batch node file associated with a task and direct it to a stream
PS C:\\>$Stream = New-Object -TypeName "System.IO.MemoryStream"
PS C:\\> Get-AzureBatchNodeFileContent -JobId "Job03" -TaskId "Task11" -Path "StdOut.txt" -DestinationStream $Stream -BatchContext $Context
The first command creates a stream by using the New-Object cmdlet, and then stores it in the $Stream variable.
The second command gets the node file that is named StdOut.txt from the task that has the ID Task11 for the job that has the ID Job03. The command
directs file contents to the stream in $Stream.
Example 4: Get a node file from a compute node and save it
PS C:\\>Get-AzureBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\\StdOut.txt" -DestinationPath
"E:\\PowerShell\\StdOut.txt" -BatchContext $Context
This command gets the node file Startup\\StdOut.txt from the compute node that has the ID ComputeNode01 in the pool that has the ID Pool01. The
command saves the file to the E:\\PowerShell\\StdOut.txt file path on the local computer.
Example 5: Get a node file from a compute node and save it by using the pipeline
PS C:\\>Get-AzureBatchNodeFile -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\\StdOut.txt" -BatchContext $Context |
Get-AzureBatchNodeFileContent -DestinationPath "E:\\PowerShell\\StdOut.txt" -BatchContext $Context
This command gets the node file Startup\\StdOut.txt by using Get-AzureBatchNodeFile from the compute node that has the ID ComputeNode01. The
compute node is in the pool that has the ID Pool01. The command passes that node file to the current cmdlet. That cmdlet saves the file to the
E:\\PowerShell\\StdOut.txt file path on the local computer.
Example 6: Get a node file from a compute node and direct it to a stream
PS C:\\>$Stream = New-Object -TypeName "System.IO.MemoryStream"
PS C:\\> Get-AzureBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "startup\\stdout.txt" -DestinationStream $Stream
-BatchContext $Context
The first command creates a stream by using the New-Object cmdlet, and then stores it in the $Stream variable.
The second command gets the node file that is named StdOut.txt from the compute node that has the ID ComputeNode01 in the pool that has the ID
Pool01. The command directs file contents to the stream in $Stream.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... ilecontent
Get-AzureRmBatchAccountKeys
Get-AzureBatchNodeFile
Azure Batch Cmdlets
SYNOPSIS
Gets a Batch node file.
SYNTAX
Get-AzureBatchNodeFileContent [-PoolId] <String> [-ComputeNodeId] <String> [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd
<Int64>] [-ByteRangeStart <Int64>] [-DefaultProfile <IAzureContextContainer>] -DestinationPath <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [-PoolId] <String> [-ComputeNodeId] <String> [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd
<Int64>] [-ByteRangeStart <Int64>] [-DefaultProfile <IAzureContextContainer>] -DestinationStream <Stream> [<CommonParameters>]
Get-AzureBatchNodeFileContent [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationPath <String> -JobId <String> -TaskId <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [[-InputObject] <PSNodeFile>] -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationPath <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [-Path] <String> -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationStream <Stream> -JobId <String> -TaskId <String> [<CommonParameters>]
Get-AzureBatchNodeFileContent [[-InputObject] <PSNodeFile>] -BatchContext <BatchAccountContext> [-ByteRangeEnd <Int64>] [-ByteRangeStart <Int64>]
[-DefaultProfile <IAzureContextContainer>] -DestinationStream <Stream> [<CommonParameters>]
DESCRIPTION
The Get-AzureBatchNodeFileContent cmdlet gets an Azure Batch node file and saves it as a file or to a stream.
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
-ByteRangeEnd <Int64>
The end of the byte range to be downloaded.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ByteRangeStart <Int64>
The start of the byte range to be downloaded.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ComputeNodeId <String>
Specifies the ID of the compute node that contains the node file that this cmdlet returns.
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
-DestinationPath <String>
Specifies the file path where this cmdlet saves the node file.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DestinationStream <Stream>
Specifies the stream into which this cmdlet writes the node file contents. This cmdlet does not close or rewind this stream.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-InputObject <PSNodeFile>
Specifies the file that this cmdlet gets, as a PSNodeFile object. To obtain a node file object, use the Get-AzureBatchNodeFile cmdlet.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByValue)
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
-Path <String>
The path of the node file to download.
Required? true
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 that contains the node file that this cmdlet gets.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-TaskId <String>
Specifies the ID of the task.
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
PSNodeFile
Parameter 'InputObject' accepts value of type 'PSNodeFile' from the pipeline
OUTPUTS
NOTES
Example 1: Get a Batch node file associated with a task and save the file
PS C:\\>Get-AzureBatchNodeFileContent -JobId "Job01" -TaskId "Task01" -Path "StdOut.txt" -DestinationPath "E:\\PowerShell\\StdOut.txt" -BatchContext
$Context
This command gets the node file that is named StdOut.txt, and saves it to the E:\\PowerShell\\StdOut.txt file path on the local computer. The
StdOut.txt node file is associated with task that has the ID Task01 for the job that has the ID Job01. Use the Get-AzureRmBatchAccountKeys cmdlet
to assign a context to the $Context variable.
Example 2: Get a Batch node file and save it to a specified file path using the pipeline
PS C:\\>Get-AzureBatchNodeFile -JobId "Job02" -TaskId "Task02" -Path "StdErr.txt" -BatchContext $Context | Get-AzureBatchNodeFileContent
-DestinationPath "E:\\PowerShell\\StdOut.txt" -BatchContext $Context
This command gets the node file that is named StdErr.txt by using the Get-AzureBatchNodeFile cmdlet. The command passes that file to the current
cmdlet by using the pipeline operator. The current cmdlet saves that file to the E:\\PowerShell\\StdOut.txt file path on the local computer. The
StdOut.txt node file is associated with the task that has the ID Task02 for the job that has the ID Job02.
Example 3: Get a Batch node file associated with a task and direct it to a stream
PS C:\\>$Stream = New-Object -TypeName "System.IO.MemoryStream"
PS C:\\> Get-AzureBatchNodeFileContent -JobId "Job03" -TaskId "Task11" -Path "StdOut.txt" -DestinationStream $Stream -BatchContext $Context
The first command creates a stream by using the New-Object cmdlet, and then stores it in the $Stream variable.
The second command gets the node file that is named StdOut.txt from the task that has the ID Task11 for the job that has the ID Job03. The command
directs file contents to the stream in $Stream.
Example 4: Get a node file from a compute node and save it
PS C:\\>Get-AzureBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\\StdOut.txt" -DestinationPath
"E:\\PowerShell\\StdOut.txt" -BatchContext $Context
This command gets the node file Startup\\StdOut.txt from the compute node that has the ID ComputeNode01 in the pool that has the ID Pool01. The
command saves the file to the E:\\PowerShell\\StdOut.txt file path on the local computer.
Example 5: Get a node file from a compute node and save it by using the pipeline
PS C:\\>Get-AzureBatchNodeFile -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "Startup\\StdOut.txt" -BatchContext $Context |
Get-AzureBatchNodeFileContent -DestinationPath "E:\\PowerShell\\StdOut.txt" -BatchContext $Context
This command gets the node file Startup\\StdOut.txt by using Get-AzureBatchNodeFile from the compute node that has the ID ComputeNode01. The
compute node is in the pool that has the ID Pool01. The command passes that node file to the current cmdlet. That cmdlet saves the file to the
E:\\PowerShell\\StdOut.txt file path on the local computer.
Example 6: Get a node file from a compute node and direct it to a stream
PS C:\\>$Stream = New-Object -TypeName "System.IO.MemoryStream"
PS C:\\> Get-AzureBatchNodeFileContent -PoolId "Pool01" -ComputeNodeId "ComputeNode01" -Path "startup\\stdout.txt" -DestinationStream $Stream
-BatchContext $Context
The first command creates a stream by using the New-Object cmdlet, and then stores it in the $Stream variable.
The second command gets the node file that is named StdOut.txt from the compute node that has the ID ComputeNode01 in the pool that has the ID
Pool01. The command directs file contents to the stream in $Stream.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... ilecontent
Get-AzureRmBatchAccountKeys
Get-AzureBatchNodeFile
Azure Batch Cmdlets