Skip to main content

Restart-CloudPC

Reboots one or more Windows 365 Cloud PCs.

Description

Issues POST /deviceManagement/virtualEndpoint/cloudPCs/{id}/reboot against Microsoft Graph, which is an asynchronous operation: Graph returns 204 No Content immediately and the actual reboot happens in the background.

Because rebooting is destructive, this cmdlet supports -WhatIf / -Confirm and defaults to ConfirmImpact = 'High'. Use -Force to suppress the confirmation prompt in automation.

Requires the CloudPC.ReadWrite.All scope; the cmdlet automatically re-authenticates via Connect-CloudPC if the current Graph session does not already have it.

Syntax


Restart-CloudPC -CloudPC <Object> [-Force] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

Restart-CloudPC -Id <string> [-Force] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

NameTypeRequiredAliasesDescription
CloudPCObjectYesA WindowsCloudPC.CloudPC object (as returned by Get-CloudPC), or a Cloud PC name or ID.
Accepts pipeline input.
ForceSwitchParameterNoSuppress the confirmation prompt. Equivalent to -Confirm:$false.
IdStringYesCloudPcIdThe Cloud PC ID (GUID) when you do not have a CloudPC object handy.
PassThruSwitchParameterNoEmit a WindowsCloudPC.RestartResult object describing the outcome of each reboot request.
By default the cmdlet is silent on success (mirrors Restart-Computer behavior).

Graph endpoints

/beta/deviceManagement/virtualEndpoint/cloudPCs/{id}/reboot

Example 1

Get-CloudPC -Type Dedicated | Restart-CloudPC -Force

Reboots every dedicated Cloud PC in the tenant without prompting.

Example 2

Restart-CloudPC -Id '95194d88-cec5-4b65-af62-26dbd1814364' -PassThru

Reboots a single Cloud PC by ID, prompts for confirmation, and emits the request result.

Example 3

Get-CloudPC | Where-Object Name -like 'CFD-brad-*' | Restart-CloudPC -WhatIf

Previews which Cloud PCs would be rebooted without sending the requests.

Source

View Restart-CloudPC.ps1 on GitHub