Export (0) Print
Expand All

Get-ComputerRestorePoint

Updated: May 8, 2014

Applies To: Windows PowerShell 4.0

Get-ComputerRestorePoint

Gets the restore points on the local computer.

Syntax

Parameter Set: ID
Get-ComputerRestorePoint [[-RestorePoint] <Int32[]> ] [ <CommonParameters>]

Parameter Set: LastStatus
Get-ComputerRestorePoint -LastStatus [ <CommonParameters>]




Detailed Description

The Get-ComputerRestorePoint cmdlet gets the restore points on the local computer. This cmdlet can also display the status of the most recent attempt to restore the computer.

You can use the information returned by Get-ComputerRestorePoint to select a restore point, and you can use the sequence number to identify a restore point for the Restore-Computer cmdlet.

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

Parameters

-LastStatus

Gets the status of the most recent system restore operation.


Aliases

none

Required?

true

Position?

named

Default Value

False

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RestorePoint<Int32[]>

Gets the restore points with the specified sequence numbers. Enter the sequence numbers of one or more restore points. By default, Get-ComputerRestorePoint gets all restore points on the local computer.


Aliases

none

Required?

false

Position?

1

Default Value

All restore points

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

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

  • None

    You cannot pipe objects to this cmdlet.


Outputs

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

  • System.Management.ManagementObject#root\default\SystemRestore or String.

    Get-ComputerRestore returns a SystemRestore object, which is an instance of the WMI SystemRestore class. When you use the LastStatus parameter, this cmdlet returns a string.


Notes

  • To run a Get-ComputerRestorePoint 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 gets all of the restore points on the local computer.


PS C:\> get-computerrestorepoint

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

This command gets the restore points with sequence numbers 232, 240, and 245.


PS C:\> get-computerrestorepoint -restorepoint 232, 240, 245

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

This command displays the status of the most recent system restore operation on the local computer.


PS C:\> get-computerrestorepoint -laststatus
The last restore failed.

-------------------------- EXAMPLE 4 --------------------------

This command displays the restore points in a table for easy reading.

The Format-Table command includes a calculated property that uses the ConvertToDateTime method to convert the value of the CreationTime property from WMI format to a DateTime object.


PS C:\> get-computerrestorepoint | format-table SequenceNumber, @{Label="Date"; Expression={$_.ConvertToDateTime($_.CreationTime)}}, Description -auto

SequenceNumber Date                  Description
-------------- ----                  -----------
253 8/5/2008 3:19:20 PM   Windows Update
254 8/6/2008 1:53:24 AM   Windows Update
255 8/7/2008 12:00:04 AM  Scheduled Checkpoint
...

-------------------------- EXAMPLE 5 --------------------------

This command gets the sequence number of the most recently created restore point on the computer.

The command uses the -1 index to get the last item in the array that Get-ComputerRestorePoint returns.


PS C:\> ((get-computerrestorepoint)[-1]).sequencenumber

Related topics



Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft