OK Gang:
I believe I have a true headscratcher for the day. Here's the 411:
LucD has been assisting me with my meager PowerShell skills and he's giving me a serious tutorial in calculated fields Sometimes the old @{ } or the E={ or @($_ } can really throw me - but i digress.
I'm getting the information that I need, but now there's the issue of how the output comes. The majority of the time, I use the Export-CSV so that I can ultimately import it into Excel and provide whatever tables my colleagues need at the time. However, many times I run into a situation like this:
The output from an Export-CSV, right after being pulled into Excel:
FDR097P | 10.2.4.97 | Symantec XXXXXX |
FDDVG125P | 10.2.4.125 | 1XXXXXXXXXXXX |
FDR2VG120P | 10.2.3.135 | XXXXXXXX Server to become New PVWA |
NetApp Performance Manager | 10.2.0.100,fe80::250:56ff:feac:b35e | OnCommand Performance Manager - Performance troubleshooting for NetApp FAS Series For more information or support please visit http://www.netapp.com |
TBCSR04 | 172.24.240.70,172.24.240.208 | XXXXXXXXXXXXXXXXXX |
FDDVG121D | 10.2.3.121 | SAP Mobility/Agentry DEV |
NetApp Unified Manager | 10.2.0.99,fe80::250:56ff:feac:7d6d | OnCommand Unified Manager - Application to monitor and manage NetApp storage systems. For more information or support please visit http://www.netapp.com |
My problem resides in Rows 4 and 7. Instead of the VM name, information from Row 3 column 3 has made it's way into that field (cell). Or the problem is that data in row 4 column 3 was so massive, that it overwrote the data in the same row, but Column 1..This was a direct output I received after my script ran and the results place in Export-CSV. I don't know if the problem is in the Export-CSV or if it's somewhere else. I keep thinking that there may be some type of field limit for the 3rd column (Notes - pulled from Notes field via Get-VM). Is the error because I haven't included a parameter which would allow the data in field (column) 3 to word wrap? Or is it some parameter that's missing from the Export-CSV command which would allow each field (or a specific field) to word wrap?
I appreciate any insight/guidance that anyone can share. I scoured Google and MSDN for a method, but I can't find one. Hopefully, one of you already has.
TIA,
Miguel :smileyconfused::smileyangry:
This might be an Excel thing.
It would be useful to see what exactly is in column 3 for the rows 4 and 7.
Can you do a, provided the result is in a variable named $report, the following command: $report | Format-List
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference