When I run the command below...
Get-Cluster yomama | Get-Datastore | Sort-Object -Property FreeSpaceGB -Descending | Format-Table -HideTableHeaders
The output is truncated then appended with a "…"
esx-somebody-made-long-name...
The actual name is
esx-somebody-made-long-name-for-the-hell-of-it
Looks like if more than 29 or 30 characters it does this.
What's the command to output the full name?
Thanks
I had high hopes for this one but I got this....
Btw, you can reset that default behaviour by using the Out-Default cmdlet.
For example
Get-Datastore -Name esx* | Sort-Object -Property FreeSpaceGB -Descending | Select @{N = 'Name'; E = {"{0}" -f $_.Name}}, FreeSpaceGB, CapacityGB
will produce
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
There is no VMware.PowerCLI module in 6.5 R1, that only appeared in 6.5.1 (which is not the same as 6.5 R1)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yep, sorry mate-- I guess we're running different versions of vSphere and the PowerCLI.
This is craziness, LucD… good find.
He can fix it by adding a simple pipe at the end:
| Format-Table
And it will make it a table again.
Get-Datastore -Name esx* | Select Name, FreeSpaceMB, FreespaceGB, CapacityMB, CapacityGB
Get-Datastore -Name esx* | Sort-Object -Property FreeSpaceGB -Descending | Select @{N = 'Name'; E = {"{0}" -f $_.Name}}, FreeSpaceGB, CapacityGB | Format-Table
Adding " | Out-Default" to the end fixed it across all execution methods including from within my VB .Net App.
Thanks again!!!
Yes, it's like writing HTML for different browsers... you think it's perfect and somebody opens up your webpage in Opera or old IE 7 and suddenly it looks like trash. Dealing with different execution methods can be quite a headache... yes, that was a strange issue and a good find by LucD that with 5 properties it would change how it would format subsequent output... strange. Glad it's fixed!