vSphere PowerCLI Reference

Get-VMHostService

Synopsis

Retrieves information of a host service.

Syntax

Get-VMHostService [-VMHost] <VMHost[]> [-Refresh] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
Set-VMHostService
Start-VMHostService
Stop-VMHostService
Restart-VMHostService

Detailed Description

Retrieves information of a host service. If the Refresh parameter is set to $true, the cmdlet refreshes the host services information before retrieving it. To specify a server different from the default one, use the -Server parameter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VMHostVMHost[]Specify hosts for which you want to retrieve the available services.truetrue (ByValue)
RefreshSwitchParameterIndicate whether the cmdlet refreshes the service information before retrieving it.falsefalse
ServerVIServer[]Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse

Return Type

HostService

Notes

Examples

-------------- Example 1 --------------

Get-VMHostService -Refresh

Refreshes and retrieves the host services on the default server.

-------------- Example 2 --------------

$host = Get-VMHost -Name Host

$vmHostService = Get-VMHostService -VMHost $host

Gets the services of the specified host.


Copyright © 1998 - 2012 VMware, Inc. All rights reserved.