Powershell:每小时创建还原点
Powershell: Create restore points hourly
我们的用户需要有 "previous version" 个必须在每天工作时间每小时保存的文件。
通过使用 vbs 可以解决此问题,然后将其安排为每小时 运行,它将每小时创建 "restore point"。
strDesc = "Automatic Restore Point"
Set oRestorePoint = GetObject("winmgmts:\.\root\default:SystemRestore")
strResult = oRestorePoint.CreateRestorePoint(strDesc, 0, 100)
我想通过使用 powershell 4.0 来实现这一点,但根据 here:
The other critical point to know when using Checkpoint-Computer cmdlet
is that you can only create a restore point with this cmdlet once
every 24 hours. You can run the command again, but it will only keep
the last restore point
那么有没有一种方法可以让我在 powershell 中设置每小时还原点?
还原点类型的 "MODIFY_SETTING" 是什么?
如果我使用不同的 "restorepointtype" 会对 "restoring a file" 产生什么影响?
我不确定你的问题是什么。您已经拥有创建还原点的代码。要每小时执行一次,请使用任务计划程序 运行 每小时。
至于MODIFY_SETTINGS
:
MODIFY_SETTINGS
12 An application has had features added or removed.
转换为 PowerShell 的示例(我已将类型设置为 MODIFY_SETTINGS
):
$strDesc = "Automatic Restore Point"
$systemrestore = [wmiclass]'\.\root\default:SystemRestore'
$systemrestore.CreateRestorePoint($strDesc, 12, 100)
我只想为该数据启用卷影复制。不需要系统检查点(此时,我不知道更多信息)。
我们的用户需要有 "previous version" 个必须在每天工作时间每小时保存的文件。
通过使用 vbs 可以解决此问题,然后将其安排为每小时 运行,它将每小时创建 "restore point"。
strDesc = "Automatic Restore Point"
Set oRestorePoint = GetObject("winmgmts:\.\root\default:SystemRestore")
strResult = oRestorePoint.CreateRestorePoint(strDesc, 0, 100)
我想通过使用 powershell 4.0 来实现这一点,但根据 here:
The other critical point to know when using Checkpoint-Computer cmdlet is that you can only create a restore point with this cmdlet once every 24 hours. You can run the command again, but it will only keep the last restore point
还原点类型的 "MODIFY_SETTING" 是什么? 如果我使用不同的 "restorepointtype" 会对 "restoring a file" 产生什么影响?
我不确定你的问题是什么。您已经拥有创建还原点的代码。要每小时执行一次,请使用任务计划程序 运行 每小时。
至于MODIFY_SETTINGS
:
MODIFY_SETTINGS
12 An application has had features added or removed.
转换为 PowerShell 的示例(我已将类型设置为 MODIFY_SETTINGS
):
$strDesc = "Automatic Restore Point"
$systemrestore = [wmiclass]'\.\root\default:SystemRestore'
$systemrestore.CreateRestorePoint($strDesc, 12, 100)
我只想为该数据启用卷影复制。不需要系统检查点(此时,我不知道更多信息)。