次の方法で共有


Set-AzBatchPool

プールのプロパティを更新します。

構文

Set-AzBatchPool
   [-Pool] <PSCloudPool>
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

説明

Set-AzBatchPool コマンドレットは、Azure Batch サービス内のプールのプロパティを更新します。 Get-AzBatchPool コマンドレットを使用して、 PSCloudPool オブジェクトを取得します。 そのオブジェクトのプロパティを変更し、現在のコマンドレットを使用して変更を Batch サービスにコミットします。

例 1: プールを更新する

$Pool = Get-AzBatchPool "ContosoPool" -BatchContext $Context
$StartTask = New-Object Microsoft.Azure.Commands.Batch.Models.PSStartTask
$StartTask.CommandLine = "cmd /c echo example"
$Pool.StartTask = $StartTask
Set-AzBatchPool -Pool $Pool -BatchContext $Context

最初のコマンドは、 Get-AzBatchPool を使用してプールを取得し、$Pool変数に格納します。 次の 3 つのコマンドは、$Pool オブジェクトの開始タスクの仕様を変更します。 最後のコマンドは、$Poolのローカル オブジェクトと一致するように Batch サービスを更新します。

パラメーター

-BatchContext

このコマンドレットが Batch サービスとの対話に使用する BatchAccountContext インスタンスを指定します。 Get-AzBatchAccount コマンドレットを使用して BatchAccountContext を取得する場合、Batch サービスと対話するときに Microsoft Entra 認証が使用されます。 代わりに共有キー認証を使用するには、Get-AzBatchAccountKey コマンドレットを使用して、アクセス キーが設定された BatchAccountContext オブジェクトを取得します。 共有キー認証を使用する場合、プライマリ アクセス キーは既定で使用されます。 使用するキーを変更するには、BatchAccountContext.KeyInUse プロパティを設定します。

型:BatchAccountContext
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-DefaultProfile

Azure との通信に使用される資格情報、アカウント、テナント、サブスクリプション。

型:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-Pool

このコマンドレットが Batch サービスを更新する PSCloudPool を指定します。

型:PSCloudPool
配置:0
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

入力

PSCloudPool

BatchAccountContext

出力

Void