PowerShell 2.0: One Cmdlet at a Time 22 Enable-ComputerRestore
Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Enable-ComputerRestore cmdlet.
What can I do with it?
Enable the System Restore feature on the specified drive.
Example:
Enable System Restore on the local C drive.
Enable-ComputerRestore -drive “C:\”
How could I have done this in PowerShell 1.0?
You could have used the SystemRestore WMI class and the Enable method
$SystemRestore = [wmiclass]"\\.\root\default:systemrestore" $SystemRestore.Enable(“c:\”)