The Get-AzBatchComputeNode cmdlet gets Azure Batch compute nodes from a pool.
Specify either the PoolID or Pool parameter.
Specify the Id parameter to get a single compute node.
Specify the Filter parameter to get the compute nodes that match an Open Data Protocol (OData) filter.
This command gets the compute node that has the ID tvm-2316545714_1-20150725t213220z from the pool that has the ID Pool06.
Use the Get-AzBatchAccountKey cmdlet to assign a context to the $Context variable.
Example 2: Get all idle compute nodes from a pool
Get-AzBatchComputeNode -PoolId "Pool06" -Filter "state eq 'idle'" -BatchContext $Context
This command gets all idle compute nodes that are contained in the pool that has the ID Pool06.
The command specifies the idle state by using the Filter parameter.
Example 3: Get all compute nodes in a specified pool
This command gets the pool that has the ID Pool07 by using the Get-AzBatchPool cmdlet.
The command passes that pool to the current cmdlet by using the pipeline operator.
That cmdlet gets all compute nodes from that pool.
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.
Specifies an OData filter clause.
This cmdlet returns compute nodes that match the filter that this parameter specifies.
If you do not specify a filter, this cmdlet returns all compute nodes for the pool.
Specifies the maximum number of compute nodes to return.
If you specify a value of zero (0) or less, the cmdlet does not use an upper limit.
The default value is 1000.
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.