The first command creates a PSPoolInformation object by using the New-Object cmdlet.
The command stores that object in the $PoolInformation variable.
The second command assigns the ID Pool22 to the PoolId property of the object in $PoolInformation.
The final command creates a job that has the ID ContosoJob35.
Tasks added to the job run on the pool that has the ID Pool22.
Use the Get-AzBatchAccountKey cmdlet to assign a context to the $Context variable.
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 the common environment variables, as key/value pairs, that this cmdlet sets for all tasks in the job.
The key is the environment variable name.
The value is the environment variable value.
Specifies the Job Preparation task.
The Batch service runs the Job Preparation task on a compute node before it starts any tasks of that job on that compute node.
Specifies the Job Release task.
The Batch service runs the Job Release task when the job ends.
The Batch service runs the Job Release task on each compute node where it ran any task of the job.
Specifies the priority of the job.
Valid values are: integers from -1000 to 1000.
A value of -1000 is the lowest priority.
A value of 1000 is the highest priority.
The default value is 0.
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.