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,
HelpMessage = "Identifier of the VRA to be updated."
)]
[ValidateNotNullOrEmpty()]
[Alias("vraId")]
[string]$vraIdentifier,
[Parameter(
HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will not modify current assignment"
)]
[ValidateNotNullOrEmpty()]
[string]$groupName,
[Parameter(
ParameterSetName = "StaticIp",
@@ -49,7 +51,7 @@ function Edit-ZertoVra {
$vraUpdate['GroupName'] = $vra.VraGroup
}
# 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') ) {
$vraNetwork['DefaultGateway'] = $defaultGateway
} else {
@@ -68,6 +70,9 @@ function Edit-ZertoVra {
$vraNetwork['VraIPConfigurationTypeApi'] = "Static"
# Add network information to update object.
$vraUpdate['VraNetworkDataApi'] = $vraNetwork
} else {
$vraNetwork['VraIPConfigurationTypeApi'] = "Dhcp"
$vraUpdate['VraNetworkDataApi'] = $vraNetwork
}
# -WhatIf processing and submit!
if ($PSCmdlet.ShouldProcess( "Updating " + $vra.vraName + " with these settings: $($vraUpdate | convertTo-Json)")) {