From 5f786775dcadb0e2c849a5a5939bc24901753719 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 11:23:20 -0400 Subject: [PATCH] Verbose Output - VM and VPG name --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 index ec5fc1c..7301083 100644 --- a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -43,6 +43,9 @@ function Add-ZertoVpgVm { } $baseUrl = "vpgsettings/{0}/vms" -f $vpgSettingsIdentifier $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier + if ($PSCmdlet.ParameterSetName -eq "VpgSettingsIdentifier") { + $VpgName = $baseSettings.Basic.Name + } $unprotectedVms = Get-ZertoUnprotectedVm $protectedVms = Get-ZertoProtectedVm $vmMap = Get-Map -inputObject $unprotectedVms -key VmName -value VmIdentifier @@ -78,7 +81,7 @@ function Add-ZertoVpgVm { continue } } - if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($VmIdentifiers, "Adding VM to Vpg")) { + if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($VmIdentifiers, "Adding VM(s): $Vm to Vpg $VpgName")) { foreach ($id in $VmIdentifiers) { # Build the Body $Body = @{VmIdentifier = $id }