Introduction

The xWindowsRestore module is a part of the Windows PowerShell Desired State Configuration (DSC) Resource Kit, which is a collection of DSC Resources. This module contains the following resources:

  • xSystemRestore: Enable or disable system restore with specified system drive.
  • xSystemRestorePoint: Simple resource for creating and removing system Checkpoint.

All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any Microsoft standard support program or service. The "x" in xWindowsRestore stands for experimental, which means that these resources will be fix forward and monitored by the module owner(s).

Please leave comments, feature requests, and bug reports in the Q & A tab for this module.

If you would like to modify xWindowsRestore module, feel free. When modifying, please update the module name, resource friendly name, and MOF class name (instructions below). As specified in the license, you may copy or modify this resource as long as they are used on the Windows Platform.

For more information about Windows PowerShell Desired State Configuration, check out the blog posts on the PowerShell Blog (this is a good starting point). There are also great community resources, such as PowerShell.org , or PowerShell Magazine . For more information on the DSC Resource Kit, check out this blog post.

Installation

To install xWindowsRestore module

  • If you are using WMF4 / PowerShell Version 4: Unzip the content under $env:ProgramFiles\WindowsPowerShell\Modules folder
  • If you are using WMF5 Preview: From an elevated PowerShell session run ‘Install-Module xWindowsRestore’

To confirm installation:

  • Run Get-DSCResource to see that the resources listed above are among the DSC Resources displayed

Requirements

This module requires PowerShell v4.0, which ships in Windows 8.1 or Windows Server 2012R2. To easily use PowerShell 4.0 on older operating systems, install WMF 4.0. Please read the installation instructions that are present on both the download page and the release notes for WMF 4.0.

Details

the xSystemRestore resource has following properties:

  • Drive: Specifies the file system drives. Enter one or more file system drive letters, each followed by a colon and a backslash and enclosed in quotation marks, such as 'C:\' or 'D:\'.
  • Ensure: Use "Present" or "Absent" to indicate that the system is or is not configured for system restore.

the xSystemRestorePoint resource has following properties:

  • Description: Specifies a descriptive name for the restore point.
  • RestorePointType: Specifies the type of restore point. The default is APPLICATION_INSTALL.
  • Ensure: Indicates if the specified restore point created. Set this property to 'Absent' to ensure that the restore point does not exist. Set it to 'Present' to ensure that the restore point does exist. The default is 'Present'.

Renaming Requirements

When making changes to these resources, we suggest the following practice:

  1. Update the following names by replacing MSFT with your company/community name and replacing the "x" with "c" (short for "Community") or another prefix of your choice:
    • Module name (ex: xWindowsRestore becomes cWindowsRestore)
    • Resource folder (ex: MSFT_xSystemRestore becomes Contoso_xSystemRestore)
    • Resource Name (ex: MSFT_xSystemRestore becomes Contoso_cSystemRestore)
    • Resource Friendly Name (ex: xSystemRestore becomes cSystemRestore)
    • MOF class name (ex: MSFT_xSystemRestore becomes Contoso_cSystemRestore)
    • Filename for the <resource>.schema.mof (ex: MSFT_xSystemRestore.schema.mof becomes Contoso_cSystemRestore.schema.mof)
  2. Update module and metadata information in the module manifest
  3. Update any configuration that use these resources

We reserve resource and module names without prefixes ("x" or "c") for future use (e.g. "MSFT_WindowsRestore" or "MSFT_ADUser"). If the next version of Windows Server ships with a "SystemRestore" resource, we don't want to break any configurations that use any community modifications. Please keep a prefix such as "c" on all community modifications.

Versions

1.0.0.0

  • Initial release with the following resources
    • xWindowsRestore
    • xSystemRestorePoint

Examples

Enable System Restore

In the Examples folder, ConfigureSystemRestore.ps1 demonstrates how to enable system restore.

 

Create A System Restore Point

In the Examples folder, CreateSystemRestorePoint.ps1 demonstrates how to create a system restore point.