Skip to content

Commit d8202e2

Browse files
fixing staticanalysis errors
1 parent 679d4ac commit d8202e2

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/Network/Network/Cortex/VirtualHub/NewAzureRmVirtualHubCommand.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public class NewAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
8585

8686
[Parameter(
8787
Mandatory = false,
88-
HelpMessage = "The route tables associated with this Virtual Hub.")]
89-
public PSVirtualHubRouteTable[] RouteTable { get; set; }
88+
HelpMessage = "The route table associated with this Virtual Hub.")]
89+
public PSVirtualHubRouteTable RouteTable { get; set; }
9090

9191
[Parameter(
9292
Mandatory = false,
@@ -157,11 +157,7 @@ public override void Execute()
157157
virtualHub.VirtualNetworkConnections.AddRange(this.HubVnetConnection);
158158
}
159159

160-
virtualHub.RouteTables = new List<PSVirtualHubRouteTable>();
161-
if (this.RouteTable != null)
162-
{
163-
virtualHub.RouteTables.AddRange(this.RouteTable);
164-
}
160+
virtualHub.RouteTable = this.RouteTable;
165161

166162
if (string.IsNullOrWhiteSpace(this.Sku))
167163
{

src/Network/Network/Cortex/VirtualHubRouteTable/AddAzureRmVirtualHubRouteCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Microsoft.Azure.Commands.Network
2323
[Cmdlet(
2424
VerbsCommon.Add,
2525
ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VirtualHubRoute",
26-
SupportsShouldProcess = false),
26+
SupportsShouldProcess = true),
2727
OutputType(typeof(PSVirtualHubRoute))]
2828
public class AddAzureRmVirtualHubRouteCommand : VirtualHubRouteTableBaseCmdlet
2929
{

src/Network/Network/Cortex/VirtualHubRouteTable/AddAzureRmVirtualHubRouteTableCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Microsoft.Azure.Commands.Network
2222

2323
[Cmdlet(VerbsCommon.Add,
2424
ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VirtualHubRouteTable",
25-
SupportsShouldProcess = false),
25+
SupportsShouldProcess = true),
2626
OutputType(typeof(PSVirtualHubRouteTable))]
2727
public class AddAzureRmVirtualHubRouteTableCommand : VirtualHubRouteTableBaseCmdlet
2828
{

0 commit comments

Comments
 (0)