Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Restore-Computer

Restore-Computer

microsoft.powershell.commands.management.dll

Synopsis

Starts a system restore on the local computer.

Syntax

Restore-Computer [-RestorePoint] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Restore-Computer cmdlet restores the local computer to the specified system restore point.

A Restore-Computer command restarts the computer. The restore is completed during the restart operation.

System restore points and the Restore-Computer cmdlet are supported only on client operating systems, such as Windows 7, Windows Vista, and Windows XP.

Parameters

-RestorePoint <Int32>

Specifies the sequence number of the restore point. To find the sequence number, use Get-ComputerRestorePoint. This parameter is required.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

None

Return Type

None

Notes

To run a Restore-Computer command on Windows Vista and later versions of Windows, open Windows PowerShell with the "Run as administrator" option.

This cmdlet uses the Windows Management Instrumentation (WMI) SystemRestore class.

Examples

-------------------------- EXAMPLE 1 --------------------------

This command restores the local computer to the restore point with sequence number 253.

Because the RestorePoint parameter is positional, you can omit the parameter name.

PS C:\>restore-computer -RestorePoint 253

-------------------------- EXAMPLE 2 --------------------------

This command restores the local computer to the restore point with sequence number 255. It uses the Confirm parameter to prompt the user before actually performing the operation.

PS C:\>restore-computer 255 -confirm

Confirm
Are you sure you want to perform this action?
Performing operation "Restore-Computer" .
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

-------------------------- EXAMPLE 3 --------------------------

These commands run a system restore and then check its status.

The first command uses the Get-ComputerRestorePoint cmdlet to get the restore points on the local computer.

The second command uses Restore-Computer to restore the computer to the restore point with sequence number 255.

The third command uses the LastStatus parameter of Get-ComputerRestorePoint cmdlet to check the status of the restore operation. Because the Restore-Computer command forces a restart, this command would be entered when the computer restarted.

PS C:\>Get-ComputerRestorePoint
PS C:\>Restore-Computer -RestorePoint 255
PS C:\>Get-ComputerRestorePoint -LastStatus

Online Version
Checkpoint-Computer
Disable-ComputerRestore
Enable-ComputerRestore
Get-ComputerRestorePoint
Restart-Computer