VMware {code} Community
kipz
Contributor
Contributor

VI Toolkit command output gets truncated

hello,

i'm using VI Toolkit (PowerShell) for collecting data about my virtual environment. recently i noticed very annoying behavior that some commands will truncate their outputs.

for example, i'm using command vm-get to collect config data about my VM-s. when i'm sending its output for formating (get-vm | fc or get-vm | fl) and there is more than 4 items of one particular HW piece (for example, virtual disk), remaining output gets truncated and replaced with "..." (three dots). here is an example:

Name : ABC

HardDisks : {Hard Disk 1, Hard Disk 2, Hard Disk 3, Hard Disk 4...}

Id : VirtualMachine-vm-578

i have noticed similar behavior with multiple commands. for example, command what lists ESX server storages. most of my ESX-s have more than 4 storages (VMFS volumes) configured and only 4 of them are listed in output. can anyone explain why such stupid truncation takes place and how to override it? in current way it makes using this VI Toolkit pointless for me.

regards,

kipz

Tags (1)
0 Kudos
1 Reply
njain
Expert
Expert

In some scenarios, the output has a limited number of columns in which it displays the data, due to which the long output gets truncated. This can be formatted using either of the fl, fc, ft or fw commands.

But here it seems that the get-vm cmdlet is retrieving the data for hard disks in this format. If you want to get the hard disks for a VM, alternatively, you can use "Get-HardDisk" cmdlet. Similarly, for fetching the ESX server storage you can use "Get-Datastore" to get the list of datastores.