vSphere PowerCLI Reference

Stop-VMHostService

Synopsis

Stops host services.

Syntax

Stop-VMHostService [-HostService] <HostService[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMHostService
Start-VMHostService
Set-VMHostService
Restart-VMHostService

Detailed Description

Stops the host service specified by the Service parameter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
HostServiceHostService[]Specify the host services you want to stop.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse$true
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

HostService

Notes

Examples

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

$vmHostService = Get-VmHostService -VMHost Host      if ($vmHostService[0].Running -eq "False") {          Start-VmHostService -Service $vmHostService[0]       } else {         Stop-VmHostService -Service $vmHostService[0]             }

Gets a list of the services on the Host. For the first service of the list, if the service is not running, starts the service. Else, stops the service.


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