Skip to content

Commit 65e7ff6

Browse files
authored
Merge pull request #115230 from DCtheGeek/dmc-batch-ghi48169
Fixes MicrosoftDocs/azure-docs#48169 - Add configuration init with PSCloudServiceConfiguration type
2 parents fd31a51 + f9845c3 commit 65e7ff6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

articles/batch/batch-powershell-cmdlets-get-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ $appPackageReference.ApplicationId = "MyBatchApplication"
242242
$appPackageReference.Version = "1.0"
243243
```
244244

245-
Now create the pool, and specify the package reference object as the argument to the `ApplicationPackageReferences` option:
245+
Now create the configuration and pool. This example uses the **CloudServiceConfiguration** parameter with a `PSCloudServiceConfiguration` type object initialized in `$configuration`, which sets the **OSFamily** to `6` for 'Windows Server 2019' and **OSVersion** to `*`. Specify the package reference object as the argument to the `ApplicationPackageReferences` option:
246246

247247
```powershell
248+
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSCloudServiceConfiguration" -ArgumentList @(6,"*") # 6 = OSFamily 'Windows Server 2019'
248249
New-AzBatchPool -Id "PoolWithAppPackage" -VirtualMachineSize "Small" -CloudServiceConfiguration $configuration -BatchContext $context -ApplicationPackageReferences $appPackageReference
249250
```
250251

0 commit comments

Comments
 (0)