< Back

Restart-AzureVM

Wed Jan 30, 2019 5:52 pm

NAME Restart-AzureVM



SYNOPSIS

Restarts an Azure virtual machine.





SYNTAX

Restart-AzureVM [-ServiceName] <String> [-Name] <String> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable

<String>] [<CommonParameters>]



Restart-AzureVM [-ServiceName] <String> [-Name] <String> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable

<String>] -Redeploy [<CommonParameters>]



Restart-AzureVM [-ServiceName] <String> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] -Redeploy

-VM <PersistentVM> [<CommonParameters>]



Restart-AzureVM [-ServiceName] <String> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] -VM

<PersistentVM> [<CommonParameters>]





DESCRIPTION

The Restart-AzureVM cmdlet requests a restart of an Azure virtual machine.





PARAMETERS

-ServiceName <String>

Specifies the name of the Azure service that contains the virtual machine to restart.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the virtual machine to restart.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Redeploy [<SwitchParameter>]

Redeploy the virtual machine.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-VM <PersistentVM>

Specifies a virtual machine object that identifies the virtual machine to restart.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

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



OUTPUTS



NOTES









-------------------------- Example 1: Restart a virtual machine --------------------------



PS C:\\>Restart-AzureVM -ServiceName "MyService01" -Name "MyVM"



This command restarts the VirtualMachine27 virtual machine running in the Azure service named Service01.

-------------------------- Example 2: Restart a virtual machine by using a virtual machine object --------------------------



PS C:\\>Get-AzureVM -ServiceName "MyService01" -Name "VirtualMachine27" | Restart-AzureVM



This command retrieves the virtual machine object for the virtual machine named MyVM and then restarts it.

-------------------------- Example 3: Redeploy a virtual machine --------------------------



PS C:\\>Restart-AzureVM -Redeploy -ServiceName "MyService01" -Name "MyVM"



This command redeploys the VirtualMachine27 virtual machine running in the Azure service named Service01.

-------------------------- Example 4: Redeploy a virtual machine by using a virtual machine object --------------------------



PS C:\\>Get-AzureVM -ServiceName "MyService01" -Name "VirtualMachine27" | Restart-AzureVM -Redeploy



This command retrieves the virtual machine object for the virtual machine named MyVM and then redeploys it.



RELATED LINKS

Get-AzureVM

Remove-AzureVM

Restart-AzureVM

Stop-AzureVM

Update-AzureVM