VMware Communities > Blogs > John Tuffin's Blog > 2008 > April > 02

Blog Posts

John Tuffin's Blog

Previous Next
2

This bit of code takes the output from Get-Datastore and converts it from megabytes to Gigabytes. It also labels the columms as FreespaceGB and CapacityGB. This is from the forums as well.


<code>Get-Datastore | ft name,@{ Label = "FreespaceGB"; Expression = { $_.FreeSpaceMB * 1MB / 1GB } }, @{ Label = "CapacityGB"; Expression = { $_.CapacityMB * 1MB / 1GB } } </code>



Apr 10, 2008 8:27 AM jfierberg

This does not work. The ft returns the following error: out-lineoutput : Object of type "Microsoft.PowerShell.Commands.Internal.Format.
FormatStartData" is not legal or not in the correct sequence. This is likely ca
used by a user-specified "format-table" command which is conflicting with the d
efault formatting.

Apr 14, 2008 8:59 AM cpqarray VMware in response to: jfierberg

I just ran the command again and it worked. Want me to send you a script and see if you get the same error?