diff --git a/PowerArubaCX/Public/Neighbors.ps1 b/PowerArubaCX/Public/Neighbors.ps1 index 8fd1e22..54fd3b4 100644 --- a/PowerArubaCX/Public/Neighbors.ps1 +++ b/PowerArubaCX/Public/Neighbors.ps1 @@ -20,6 +20,9 @@ function Get-ArubaCXNeighbors { #> Param( + [Parameter (Mandatory = $false, ValueFromPipeline = $true)] + [ValidateScript( { Confirm-ArubaCXVrfs $_ })] + [psobject]$vrf_pp, [Parameter(Mandatory = $false, position = 1)] [String]$vrf = "*", [Parameter(Mandatory = $false)] @@ -42,6 +45,11 @@ function Get-ArubaCXNeighbors { Process { + #get vrf name from vrf_pp ps object (based by pipeline) + if ($vrf_pp) { + $vrf = $vrf_pp.name + } + $invokeParams = @{ } if ( $PsBoundParameters.ContainsKey('depth') ) { $invokeParams.add( 'depth', $depth )