O'Reilly logo

Windows PowerShell™ Scripting Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with System Restore

There are basically two WMI classes that can be used to manage system restore on a computer. These classes are SystemRestore and SystemRestoreConfig. In this section, you'll examine using both of these classes to manage system restore on both local and remote computers.

Retrieving System Restore Settings

In working with the GetSystemRestoreSettings.ps1 script, first use the param statement to permit the use of command-line arguments to the script. Define two parameters: -computer and -help. This allows you to target a remote computer and to obtain help, if required. The -computer parameter is set to a default value of localhost. This line of code is displayed here:

Param($computer = "localhost", $help)

Next, work with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required