Hi everyone,
I have these 3 one-liners that get me various information, Im having trouble combing them so the output looks nice. I know this is not strictly Powershell, I have some PowerCLI in there:
$esx = (Get-Cluster -Name "ClusterName" | Get-VMHost | Get-VMHostNetworkAdapter -VMKernel |
Select-Object VMHost, Name, IP, SubnetMask, PortGroupName, mtu, VMKernelGateway, Gateway | Export-Csv -Path c:\temp\test.csv)
$esxnetwork = (Get-Cluster -Name "ClusterName" | Get-VMHost | Get-VMHostNetworkStack | Select-Object -Property VMHost, DnsHostName, Gateway, ID, IPv6Enabled, DnsAddress, DnsSearchDomain) | Export-Csv -Path c:\temp\test1.csv -Append -Force
$NTP = (Get-Cluster -Name "ClusterName" | Get-VMHost | Select-Object name, @{l = ”ServiceRunning”; e = { get-vmhostservice $_ | Where-Object { $_.key -like “ntpd” } | Select-Object -expand running } }, @{l = ”NTPServer”; E = { get-vmhostntpserver $_ } }) | Export-Csv -Path c:\temp\ntp.csv -Append -Force
As it is now, if I run those commands and look at each variable, it looks ok. But when I append them all to the CSV file, not so much. Im losing some output and it just doesnt look good at all.
Thanks for any help.
Matt