From ca6f6abeb7c36d79075da7fef2cf868f4bc1cec0 Mon Sep 17 00:00:00 2001 From: Markus Kraus Date: Thu, 7 May 2020 20:42:54 +0200 Subject: [PATCH] remove reporting array and sort --- Scripts/Get-VMHostUplinkDetails.ps1 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Scripts/Get-VMHostUplinkDetails.ps1 b/Scripts/Get-VMHostUplinkDetails.ps1 index 899eb54..9c0b25e 100644 --- a/Scripts/Get-VMHostUplinkDetails.ps1 +++ b/Scripts/Get-VMHostUplinkDetails.ps1 @@ -31,7 +31,7 @@ function Get-VMHostUplinkDetails { Get-VMHost -Name MyHost | Get-VMHostUplinkDetails -Type LLDP | Where-Object {$_.VDS -ne "-No Backing-"} | Format-Table -AutoSize .Example - Get-VMHost -Name MyHost | Get-VMHostUplinkDetails -Type CDP | Where-Object {$_.VDS -ne "-No Backing-"} | Format-Table -AutoSize + Get-VMHost -Name MyHost | Get-VMHostUplinkDetails -Type CDP | Where-Object {$_.VDS -ne "-No Backing-"} | Sort-Object ClusterName, HostName, vmnic | Format-Table -AutoSize .Example Get-Cluster -Name MyCluster | Get-VMHost | Get-VMHostUplinkDetails -Type LLDP | Format-Table -AutoSize @@ -137,16 +137,8 @@ Begin { Process { - $MyView = @() + $VMHost | Foreach-Object { Write-Output (Get-Info $_) } + +} - foreach ($myHost in $VMhost) { - - $Info = Get-Info $myHost - $MyView += $Info - - } - - $MyView | Sort-Object ClusterName, HostName, vmnic - - } }