Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Restore-Computer

Updated: August 9, 2015

Restore-Computer

Starts a system restore on the local computer.

Syntax

Parameter Set: Default
Restore-Computer [-RestorePoint] <Int32> [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

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

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

System restore points and Restore-Computer 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 the Get-ComputerRestorePoint cmdlet. This parameter is required.


Aliases

SequenceNumber,SN,RP

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

    You cannot pipe input to this cmdlet.


Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

    This cmdlet does not generate any output.


Notes

  • To run a Restore-Computer command on Windows Vista and later versions of the Windows operating system, open Windows PowerShell by using the Run as administrator option.

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

Examples

Example 1: Restore the local computer

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


PS C:\> Restore-Computer -RestorePoint 253

Example 2: Restore the local computer with confirmation

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


PS C:\> Restore-Computer -RestorePoint 255 -Confirm

Example 3: Restore a computer and check the status

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

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

The second command restores 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 Restore-Computer forces a restart, this command would be entered after the computer restarts.


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

Related topics

Community Additions

ADD
Show:
© 2016 Microsoft