< Back

Restart-VsphereVm

Sat Jan 18, 2020 9:38 am

NAME Restart-VsphereVm



SYNOPSIS

Restarts a running VM.





SYNTAX

Restart-VsphereVm -InputObject <PSObject[]> [-RebootGuestOs <Boolean>] [-WaitForVmState {VM Powered On | VM Guest

OS Running | VM Tools Running | Do Not Wait}] [-TimeoutSeconds <UInt32>] -Connection <Hashtable>

[<CommonParameters>]



Restart-VsphereVm -VmId <String[]> [-RebootGuestOs <Boolean>] [-WaitForVmState {VM Powered On | VM Guest OS

Running | VM Tools Running | Do Not Wait}] [-TimeoutSeconds <UInt32>] -Connection <Hashtable> [<CommonParameters>]





DESCRIPTION

Restarts a running VM.





PARAMETERS

-InputObject <PSObject[]>

Object representing the VM that is to be restarted. Use Get-VsphereObject to retrieve input object.



Required? true

Position? named

Default value

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-RebootGuestOs [<Boolean>]

Specifies whether the VM Guest OS will be rebooted (soft restart) or if the VM power will be reset (hard

restart). The VM must have VMware Tools installed and running in order for the activity to reboot (soft

restart) the VM.





Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-WaitForVmState [<String>]

Specifies a VM state that the activity will be waiting for before completing. When the activity is configured

to wait for a state, the VM is first Shut Down or Powered Off (as specified by Reboot Guest OS) and then it is

started again. Accepted values are:

VM Powered On ???????? activity waits until the VM is in poweredOn state.

VM Guest OS Running ???????? activity waits until VM Guest operating system is in running state.

VM Tools Running ???????? activity waits until VMware Tools are in guestToolsRunning running state.

Do Not Wait ???????? activity does not wait.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-TimeoutSeconds [<UInt32>]

Specifies the number of seconds before the command times out, when Wait For VM State is configured to wait for

a VM state. If this parameter is not specified and Wait For VM State is configured so that the command waits,

the command will not time out, it will wait indefinitely until the specified state is reached.





Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Connection <Hashtable>

Specifies connection information to the vCenter server. For example:

@{ServerUrl='<vCenter Server URL>';User='<user>';Password='<password>';LicenseKey=<license

key>;SkipCertificateValidation=$false}



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-VmId <String[]>

ID (managed object reference) of the VM that is to be restarted.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Management.Automation.PSObject[]







OUTPUTS

System.String

ID (managed object reference) of the VM that was restarted.







RELATED LINKS