When we use any cmdlet, it does a lot of background work and provides us nice, formatted output. This has the positive effect of making our life easier and we can be blissfully ignorant of the underlying complexities. But, due to the same reason, it also runs a bit slower and hides a lot of information. If we want to get more information about objects, then we need to use the Get-View
cmdlet. For example, let's look at the output of the following two cmdlets:
PS C:\> Get-VMHost -Name ESXi1.lab.com PS C:\> Get-VMHost -Name ESXi1.lab.com | Get-View
The results of the preceding commands are shown in the following screenshot:
As you can see from the preceding screenshot, Get-View
provides much more detailed information than the simple Get-VMHost
cmdlet. We can further pinpoint the data that we are looking for by using the –ViewType
and –Filter
parameters. The ViewType
parameter lets us select the data for a particular type of object...