Being a new PowerShell user I am wondering how to find out what objects are available within a cmdlet? I have tried piping through get-view and also format-custom to find available objects.
How did the author of this code know that the following was available under the Config object? And how do you find all of the other available objects?
$VMHostView.Config.ConsoleReservation.ServiceConsoleReserved
Using the Get-VMhost cmdlet as an example here is what I've found.
Get-VMhost | Get-View
Runtime : VMware.Vim.HostRuntimeInfo
Summary : VMware.Vim.HostListSummary
Hardware : VMware.Vim.HostHardwareInfo
Capability : VMware.Vim.HostCapability
ConfigManager : VMware.Vim.HostConfigManager
Config : VMware.Vim.HostConfigInfo
Vm : {VirtualMachine-vm-104, VirtualMachine-vm-37, VirtualMachine-vm-41}
Datastore : {Datastore-datastore-13, Datastore-datastore-15}
Network : {Network-network-17, Network-network-18, Network-network-19}
DatastoreBrowser : HostDatastoreBrowser-datastorebrowser-63
SystemResources : VMware.Vim.HostSystemResourceInfo
Parent : ClusterComputeResource-domain-c7
CustomValue : {}
OverallStatus : green
ConfigStatus : green
ConfigIssue : {}
EffectiveRole : {-1}
Permission : {}
Name : esx01.company.local
DisabledMethod : {ExitMaintenanceMode_Task, PowerUpHostFromStandBy_Task, ReconnectHost_Task}
RecentTask : {}
DeclaredAlarmState : {alarm-1.host-10, alarm-13.host-10, alarm-14.host-10, alarm-15.host-10...}
TriggeredAlarmState : {}
AlarmActionsEnabled : True
Tag : {}
Value : {}
AvailableField : {}
MoRef : HostSystem-host-10
Client : VMware.Vim.VimClient
Get-VMhost | Format-Custom
class VMHostImpl
{
State = Connected
ConnectionState = Connected
PowerState = PoweredOn
VMSwapfileDatastoreId =
VMSwapfilePolicy = Inherit
ParentId = ClusterComputeResource-domain-c7
Manufacturer = HP
Model = ProLiant DL380 G5
NumCpu = 8
CpuTotalMhz = 23992
CpuUsageMhz = 88
MemoryTotalMB = 8190
MemoryUsageMB = 1369
ProcessorType = Intel(R) Xeon(R) CPU X5450 @ 3.00GHz
HyperthreadingActive = False
TimeZone =
class VMHostTimeZoneImpl
{
VMHostId = HostSystem-host-10
Description = CDT
GmtOffset = -18000
Key = America/Chicago
Name = America/Chicago
}
Version = 4.0.0
Build = 256968
CustomFields =
[
]
Id = HostSystem-host-10
Name = esx01.company.local
}