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-AzBatchAccountKey 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
This command gets the node file that is named StdErr.txt by using the Get-AzBatchNodeFile 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
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
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
This command gets the node file Startup\StdOut.txt by using Get-AzBatchNodeFile 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
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.
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.
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.