PowerCLI Reference

Get-VMHostService

Synopsis

This cmdlet retrieves information about 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

This cmdlet retrieves information about 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[]Specifies hosts for which you want to retrieve the available services.trueTrue (ByValue)
RefreshSwitchParameterIndicates whether the cmdlet refreshes the service information before retrieving it.falseFalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed 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

Zero or more HostService objects

Notes

Examples

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

Get-VMHostService -Refresh

Refreshes and retrieves the host services on the default server.

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

$vmhost = Get-VMHost -Name Host

$vmHostService = Get-VMHostService -VMHost $vmhost

Gets the services of the specified host.


Copyright © VMware, Inc. All rights reserved.