Skip to content

Commit 6af8281

Browse files
committed
Change boolean parameter to SwitchParameter
1 parent 12ed188 commit 6af8281

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ function Get-DefaultCRPImage
356356
$defaultPublisher = $result[0];
357357
}
358358

359-
$result = (Get-AzureRmVMImageOffer -Location $loc -PublisherName $defaultPublisher) | select -ExpandProperty Offer | where { $_ -like '*Windows*' -and -not ($_ -like '*HUB') };
359+
$result = (Get-AzureRmVMImageOffer -Location $loc -PublisherName $defaultPublisher) | select -ExpandProperty Offer | where { $_ -like '*WindowsServer*' -and -not ($_ -like '*HUB') };
360360
if ($result.Count -eq 1)
361361
{
362362
$defaultOffer = $result;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,24 @@ function Test-VirtualMachineScaleSet-Common($IsManaged)
102102
$exttype = 'BGInfo';
103103
$extver = '2.1';
104104

105+
$ipCfg = New-AzureRmVmssIPConfig -Name 'test' -SubnetId $subnetId -Primary;
106+
Assert-True { $ipCfg.Primary };
107+
105108
$ipCfg = New-AzureRmVmssIPConfig -Name 'test' -SubnetId $subnetId;
109+
Assert-False { $ipCfg.Primary };
110+
106111
$vmss = New-AzureRmVmssConfig -Location $loc -SkuCapacity 2 -SkuName 'Standard_A0' -UpgradePolicyMode 'automatic' -NetworkInterfaceConfiguration $netCfg -Overprovision $false `
107112
| Add-AzureRmVmssNetworkInterfaceConfiguration -Name 'test' -Primary $true -IPConfiguration $ipCfg `
108113
| Set-AzureRmVmssOSProfile -ComputerNamePrefix 'test' -AdminUsername $adminUsername -AdminPassword $adminPassword `
109114
| Add-AzureRmVmssExtension -Name $extname -Publisher $publisher -Type $exttype -TypeHandlerVersion $extver -AutoUpgradeMinorVersion $true `
110115
| Remove-AzureRmVmssExtension -Name $extname `
111116
| Add-AzureRmVmssNetworkInterfaceConfiguration -Name 'test2' -IPConfiguration $ipCfg `
112117
| Remove-AzureRmVmssNetworkInterfaceConfiguration -Name 'test2'
118+
119+
$vmss | Add-AzureRmVmssNetworkInterfaceConfiguration -Name 'test3' -IPConfiguration $ipCfg -EnableAcceleratedNetworking;
120+
Assert-True { $vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[1].EnableAcceleratedNetworking };
121+
$vmss | Remove-AzureRmVmssNetworkInterfaceConfiguration -Name 'test3'
122+
113123
if ($IsManaged -eq $true)
114124
{
115125
$vmss = $vmss | Set-AzureRmVmssStorageProfile -OsDiskCreateOption 'FromImage' -OsDiskCaching 'None' `

src/ResourceManager/Compute/Commands.Compute/Generated/VirtualMachineScaleSet/Config/AddAzureRmVmssNetworkInterfaceConfigurationCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public partial class AddAzureRmVmssNetworkInterfaceConfigurationCommand : Micros
6767
[Parameter(
6868
Mandatory = false,
6969
ValueFromPipelineByPropertyName = true)]
70-
public bool? EnableAcceleratedNetworking { get; set; }
70+
public SwitchParameter EnableAcceleratedNetworking { get; set; }
7171

7272
[Parameter(
7373
Mandatory = false,

src/ResourceManager/Compute/Commands.Compute/Generated/VirtualMachineScaleSet/Config/NewAzureRmVmssIpConfigCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public partial class NewAzureRmVmssIpConfigCommand : Microsoft.Azure.Commands.Re
7272
[Parameter(
7373
Mandatory = false,
7474
ValueFromPipelineByPropertyName = true)]
75-
public bool? Primary { get; set; }
75+
public SwitchParameter Primary { get; set; }
7676

7777
[Parameter(
7878
Mandatory = false,

src/ResourceManager/Compute/Commands.Compute/help/Add-AzureRmVmssNetworkInterfaceConfiguration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Adds a network interface configuration to the VMSS.
1515
```
1616
Add-AzureRmVmssNetworkInterfaceConfiguration [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
1717
[[-Name] <String>] [[-Primary] <Boolean>] [[-Id] <String>]
18-
[[-IpConfiguration] <VirtualMachineScaleSetIPConfiguration[]>] [-EnableAcceleratedNetworking <Boolean>]
18+
[[-IpConfiguration] <VirtualMachineScaleSetIPConfiguration[]>] [-EnableAcceleratedNetworking]
1919
[-NetworkSecurityGroupId <String>] [-DnsSettingsDnsServer <String[]>] [-WhatIf] [-Confirm]
2020
[<CommonParameters>]
2121
```
@@ -53,7 +53,7 @@ Accept wildcard characters: False
5353
Specifies whether the network interface is accelerated networking-enabled.
5454
5555
```yaml
56-
Type: Boolean
56+
Type: SwitchParameter
5757
Parameter Sets: (All)
5858
Aliases:
5959

src/ResourceManager/Compute/Commands.Compute/help/New-AzureRmVmssIpConfig.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Creates an IP configuration for a network interface of a VMSS.
1515
```
1616
New-AzureRmVmssIpConfig [[-Name] <String>] [[-Id] <String>] [[-SubnetId] <String>]
1717
[[-ApplicationGatewayBackendAddressPoolsId] <String[]>] [[-LoadBalancerBackendAddressPoolsId] <String[]>]
18-
[[-LoadBalancerInboundNatPoolsId] <String[]>] [-Primary <Boolean>] [-PrivateIPAddressVersion <String>]
18+
[[-LoadBalancerInboundNatPoolsId] <String[]>] [-Primary] [-PrivateIPAddressVersion <String>]
1919
[-PublicIPAddressConfigurationName <String>] [-PublicIPAddressConfigurationIdleTimeoutInMinutes <Int32>]
2020
[-DnsSetting <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
2121
```
@@ -149,7 +149,7 @@ Accept wildcard characters: False
149149
Specifies the primary IP Configuration in case the network interface has more than one IP Configuration.
150150
151151
```yaml
152-
Type: Boolean
152+
Type: SwitchParameter
153153
Parameter Sets: (All)
154154
Aliases:
155155

0 commit comments

Comments
 (0)