Provide minimal information when updating group-name

This commit is contained in:
Wes Carroll
2019-03-30 23:20:35 -04:00
parent c68225c458
commit 22d1151c66
+6 -1
View File
@@ -6,11 +6,13 @@ function Edit-ZertoVra {
Mandatory = $true, Mandatory = $true,
HelpMessage = "Identifier of the VRA to be updated." HelpMessage = "Identifier of the VRA to be updated."
)] )]
[ValidateNotNullOrEmpty()]
[Alias("vraId")] [Alias("vraId")]
[string]$vraIdentifier, [string]$vraIdentifier,
[Parameter( [Parameter(
HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will not modify current assignment" HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will not modify current assignment"
)] )]
[ValidateNotNullOrEmpty()]
[string]$groupName, [string]$groupName,
[Parameter( [Parameter(
ParameterSetName = "StaticIp", ParameterSetName = "StaticIp",
@@ -49,7 +51,7 @@ function Edit-ZertoVra {
$vraUpdate['GroupName'] = $vra.VraGroup $vraUpdate['GroupName'] = $vra.VraGroup
} }
# If ParameterSetName StaticIp is used, update the parameters submitted # If ParameterSetName StaticIp is used, update the parameters submitted
if ( $PSCmdlet.ParameterSetName -eq 'StaticIp' ) { if ( $PSCmdlet.ParameterSetName -eq 'StaticIp' -or $vra.VraNetworkDataApi.VraIPConfigurationTypeApi -eq "Static" ) {
if ( $PSBoundParameters.ContainsKey('defaultGateway') ) { if ( $PSBoundParameters.ContainsKey('defaultGateway') ) {
$vraNetwork['DefaultGateway'] = $defaultGateway $vraNetwork['DefaultGateway'] = $defaultGateway
} else { } else {
@@ -68,6 +70,9 @@ function Edit-ZertoVra {
$vraNetwork['VraIPConfigurationTypeApi'] = "Static" $vraNetwork['VraIPConfigurationTypeApi'] = "Static"
# Add network information to update object. # Add network information to update object.
$vraUpdate['VraNetworkDataApi'] = $vraNetwork $vraUpdate['VraNetworkDataApi'] = $vraNetwork
} else {
$vraNetwork['VraIPConfigurationTypeApi'] = "Dhcp"
$vraUpdate['VraNetworkDataApi'] = $vraNetwork
} }
# -WhatIf processing and submit! # -WhatIf processing and submit!
if ($PSCmdlet.ShouldProcess( "Updating " + $vra.vraName + " with these settings: $($vraUpdate | convertTo-Json)")) { if ($PSCmdlet.ShouldProcess( "Updating " + $vra.vraName + " with these settings: $($vraUpdate | convertTo-Json)")) {