編輯

共用方式為


Get-AzBatchComputeNodeExtension

Gets Batch compute node extensions from a compute node.

Syntax

Get-AzBatchComputeNodeExtension
   [-PoolId] <String>
   [-ComputeNodeId] <String>
   [[-Name] <String>]
   [-Select <String>]
   [-MaxCount <Int32>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzBatchComputeNodeExtension
   [-Pool] <PSCloudPool>
   [-ComputeNodeId] <String>
   [[-Name] <String>]
   [-Select <String>]
   [-MaxCount <Int32>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

If an extension name is provided, a single extension with a matching name is returned from the provided compute node (if found). Otherwise, all extensions on teh compute node is returned. Further extension details can be found on the extension's VmExtension Property.

Examples

Example 1 Get all extensions from a compute node.

Get-AzBatchComputeNodeExtension "testPool" "testNode" -BatchContext $context

InstanceView                                                    ProvisioningState VmExtension
------------                                                    ----------------- -----------
Microsoft.Azure.Commands.Batch.Models.PSVMExtensionInstanceView Succeeded         Microsoft.Azure.Commands.Batch.Models.PSVMExtension
Microsoft.Azure.Commands.Batch.Models.PSVMExtensionInstanceView Failed            Microsoft.Azure.Commands.Batch.Models.PSVMExtension

Example 2 Get a specific extension from a compute node.

Get-AzBatchComputeNodeExtension "testPool" "testNode" "secretext" -BatchContext $context

InstanceView                                                    ProvisioningState VmExtension
------------                                                    ----------------- -----------
Microsoft.Azure.Commands.Batch.Models.PSVMExtensionInstanceView Failed            Microsoft.Azure.Commands.Batch.Models.PSVMExtension

Parameters

-BatchContext

The BatchAccountContext instance to use when interacting 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-AzBatchAccountKeys 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.

Type:BatchAccountContext
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ComputeNodeId

The id of the compute node to which the extension belongs.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxCount

Specifies the maximum number of compute node extensions to return.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the extension to get.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Pool

The pool to which the extension's compute node belongs.

Type:PSCloudPool
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PoolId

The id of the pool to which the extension's compute node belongs.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Select

Specifies an OData select clause. Specify a value for this parameter to get specific properties rather than all object properties.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSCloudPool

BatchAccountContext

Outputs

PSNodeVMExtension