Get-ComputerRestorePoint

Updated: August 9, 2015

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 this cmdlet 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

Indicates that this cmdlet gets the status of the most recent system restore operation.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RestorePoint<Int32[]>

Specifies the restore points, as sequence numbers, that this cmdlet gets. Enter the sequence numbers of one or more restore points. By default, this cmdlet gets all restore points on the local computer.


Aliases

none

Required?

false

Position?

1

Default Value

none

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 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.

    This cmdlet returns a SystemRestore object, which is an instance of the Windows Management Instrumentation (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 WMI SystemRestore class.

Examples

Example 1: Get all System Restore points from the local computer

This command gets all of the System Restore points on the local computer.


PS C:\> Get-ComputerRestorePoint

Example 2: Get all System Restore points with the specified sequence numbers

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


PS C:\> Get-ComputerRestorePoint -RestorePoint 232, 240, 245

Example 3: Display the status of the most recent system restore operation on the local computer

This command displays the status of the most recent System Restore operation on the local computer.


PS C:\> Get-ComputerRestorePoint -LastStatus

Example 4: Display all the System Restore points in a table

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

The Format-Table cmdlet 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







Example 5: Get the sequence number of the most recent System Restore point

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 this cmdlet returns.


PS C:\> ((Get-ComputerRestorePoint)[-1]).sequencenumber

Related topics

Community Additions

ADD
Show: