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