Skip to content

Commit 69516a3

Browse files
Merge branch 'preview' into sergey-whatif
2 parents e38ff70 + af9c1bf commit 69516a3

File tree

15 files changed

+2989
-17
lines changed

15 files changed

+2989
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To install the module containing the legacy RDFE cmdlets, run the following comm
3838
Install-Module -Name Azure
3939
```
4040

41-
If you have an earlier version of the Azure PowerShell modules installed from the PowerShell Gallery and would like to update to the latest version, run the following commands in an elevated PowerShell session:
41+
If you have an earlier version of the Azure PowerShell modules installed from the PowerShell Gallery and would like to update to the latest version, run the following commands in an elevated PowerShell session. Update-Module installs the new version side-by-side with the old version. It does not remove the old version.
4242

4343
```powershell
4444
# Update to the latest version of AzureRM

src/ResourceManager/AzureBatch/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020
## Current Release
2121
* Set minimum dependency of module to PowerShell 5.0
22+
* Updated New-AzureBatchPool documentation to remove deprecated example
2223

2324
## Version 4.0.6
2425
* Updated to the latest version of the Azure ClientRuntime

src/ResourceManager/AzureBatch/Commands.Batch/help/New-AzureBatchPool.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,34 +76,48 @@ The **New-AzureBatchPool** cmdlet creates a pool in the Azure Batch service unde
7676

7777
## EXAMPLES
7878

79-
### Example 1: Create a new pool using the TargetDedicated parameter set
79+
### Example 1: Create a new pool using the TargetDedicated parameter set using CloudServiceConfiguration
8080
```
81-
PS C:\>New-AzureBatchPool -Id "MyPool" -VirtualMachineSize "Small" -OSFamily "4" -TargetOSVersion "*" -TargetDedicatedComputeNodes 3 -BatchContext $Context
81+
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSCloudServiceConfiguration" -ArgumentList @(4,"*")
82+
PS C:\>New-AzureBatchPool -Id "MyPool" -VirtualMachineSize "Small" -CloudServiceConfiguration $configuration -TargetDedicatedComputeNodes 3 -BatchContext $Context
83+
```
84+
85+
### Example 2: Create a new pool using the TargetDedicated parameter set using VirtualMachineConfiguration
86+
```
87+
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
88+
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
89+
PS C:\>New-AzureBatchPool -Id "MyPool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -BatchContext $Context
8290
```
8391

8492
This command creates a new pool with ID MyPool using the TargetDedicated parameter set.
8593
The target allocation is three compute nodes.
8694
The pool is configured to use small virtual machines imaged with the latest operating system version of family four.
8795

88-
### Example 2: Create a new pool using the AutoScale parameter set
96+
### Example 3: Create a new pool using the AutoScale parameter set
8997
```
90-
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -OSFamily "4" -TargetOSVersion "*" -AutoScaleFormula '$TargetDedicated=2;' -BatchContext $Context
98+
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
99+
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
100+
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -AutoScaleFormula '$TargetDedicated=2;' -BatchContext $Context
91101
```
92102

93103
This command creates a new pool with ID AutoScalePool using the AutoScale parameter set.
94104
The pool is configured to use small virtual machines imaged with the latest operating system version of family four, and the target number of compute nodes are determined by the Autoscale formula.
95105

96-
### Example 3: Create a pool with nodes in a subnet
106+
### Example 4: Create a pool with nodes in a subnet
97107
```
108+
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
109+
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
98110
PS C:\>$networkConfig = New-Object Microsoft.Azure.Commands.Batch.Models.PSNetworkConfiguration
99111
PS C:\>$networkConfig.SubnetId = "/subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}"
100-
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -OSFamily "4" -TargetDedicatedComputeNodes 3 -NetworkConfiguration $networkConfig -BatchContext $Context
112+
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -NetworkConfiguration $networkConfig -BatchContext $Context
101113
```
102114

103-
### Example 4: Create a pool with custom user accounts
115+
### Example 5: Create a pool with custom user accounts
104116
```
117+
PS C:\$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "*")
118+
PS C:\>$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.VirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
105119
PS C:\>$userAccount = New-Object Microsoft.Azure.Commands.Batch.Models.PSUserAccount -ArgumentList @("myaccount", "mypassword")
106-
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -OSFamily "4" -TargetDedicatedComputeNodes 3 -UserAccount $userAccount
120+
PS C:\>New-AzureBatchPool -Id "AutoScalePool" -VirtualMachineSize "Small" -VirtualMachineConfiguration $configuration -TargetDedicatedComputeNodes 3 -UserAccount $userAccount
107121
```
108122

109123
## PARAMETERS

src/ResourceManager/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020
## Current Release
2121
* `New-AzureRmVm` and `New-AzureRmVmss` support verbose output of parameters
22+
* `New-AzureRmVm` and `New-AzureRmVmss` (simple parameter set) support a `Win10` image.
2223
* `Repair-AzureRmVmssServiceFabricUpdateDomain` cmdlet is added.
2324
* Set minimum dependency of module to PowerShell 5.0
2425

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/StrategiesVirtualMachineTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ public void TestSimpleNewVm()
3838
ComputeTestController.NewInstance.RunPsTest("Test-SimpleNewVm");
3939
}
4040

41+
[Fact]
42+
[Trait(Category.AcceptanceType, Category.Flaky)]
43+
public void TestNewVmWin10()
44+
{
45+
ComputeTestController.NewInstance.RunPsTest("Test-NewVmWin10");
46+
}
47+
4148
[Fact]
4249
[Trait(Category.AcceptanceType, Category.CheckIn)]
4350
public void TestSimpleNewVmWithAvailabilitySet()

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/StrategiesVirtualMachineTests.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,41 @@ function Test-SimpleNewVm
4040
}
4141
}
4242

43+
<#
44+
.SYNOPSIS
45+
Test Simple Paremeter Set for New Vm win Win10 and data disks
46+
#>
47+
function Test-NewVmWin10
48+
{
49+
# Setup
50+
$vmname = Get-ResourceName
51+
52+
try
53+
{
54+
$username = "admin01"
55+
$passwordSuffix = Get-ResourceName
56+
$password = "werWER345#%^$passwordSuffix" | ConvertTo-SecureString -AsPlainText -Force
57+
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
58+
[string]$domainNameLabel = "$vmname-$vmname".tolower();
59+
60+
# Common
61+
$x = New-AzureRmVM `
62+
-Name $vmname `
63+
-Credential $cred `
64+
-DomainNameLabel $domainNameLabel `
65+
-ImageName "Win10" `
66+
-DataDiskSizeInGb 32,64
67+
68+
Assert-AreEqual 2 $x.StorageProfile.DataDisks.Count
69+
Assert-AreEqual $vmname $x.Name;
70+
}
71+
finally
72+
{
73+
# Cleanup
74+
Clean-ResourceGroup $vmname
75+
}
76+
}
77+
4378
<#
4479
.SYNOPSIS
4580
Test Simple Paremeter Set for New Vm

0 commit comments

Comments
 (0)