vSphere PowerCLI Reference

Restart-VMHostService

Synopsis

Restarts the specified host services.

Syntax

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

Related Commands

Online version
Get-VMHostService
Set-VMHostService
Start-VMHostService
Stop-VMHostService

Detailed Description

Restarts the specified host services.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
HostServiceHostService[]Specify the host service you want to restart.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 --------------

$sshd = Get-VMHostService -VMHost $host | where {$_.Key -eq 'sshd'}  Restart-VMHostService $sshd -Confirm

Restarts the sshd (SSH Server) service of the specified host.


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