Restore-Computer
在本機電腦上啟動系統還原。
語法
Default (預設值)
Restore-Computer
[-RestorePoint] <Int32>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Restore-Computer Cmdlet 會將本機計算機還原至指定的系統還原點。
Restore-Computer 重新啟動電腦。 還原會在重新啟動作業期間完成。
只有 Windows 7、Windows Vista 和 Windows XP 等用戶端操作系統才支援系統還原點和 Restore-Computer。
範例
範例 1:還原本機計算機
PS C:\> Restore-Computer -RestorePoint 253
此命令會將本機計算機還原至序號為 253 的還原點。
範例 2:使用確認還原本機計算機
PS C:\> Restore-Computer -RestorePoint 255 -Confirm
Confirm
Are you sure you want to perform this action?
Performing operation "Restore-Computer" .
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
此命令會將本機計算機還原至序號為 255 的還原點。 它會使用 Confirm 參數,在實際執行作業之前提示使用者。
範例 3:還原計算機並檢查狀態
PS C:\> Get-ComputerRestorePoint
PS C:\> Restore-Computer -RestorePoint 255
PS C:\> Get-ComputerRestorePoint -LastStatus
這些命令會執行系統還原,然後檢查其狀態。
第一個命令會使用 Get-ComputerRestorePoint 取得本機電腦上的還原點。
第二個命令會將計算機還原到序號為 255 的還原點。
第三個命令會使用 get-ComputerRestorePoint Cmdlet
參數
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
參數屬性
| 類型: | SwitchParameter |
| 預設值: | False |
| 支援萬用字元: | False |
| 不要顯示: | False |
| 別名: | cf |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-RestorePoint
指定還原點的序號。 若要尋找序號,請使用 Get-ComputerRestorePoint Cmdlet。 這是必要參數。
參數屬性
| 類型: | Int32 |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
| 別名: | 序列號碼, SN, RP |
參數集
(All)
| Position: | 0 |
| 必要: | True |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 指令未執行。
參數屬性
| 類型: | SwitchParameter |
| 預設值: | False |
| 支援萬用字元: | False |
| 不要顯示: | False |
| 別名: | 無線 |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
CommonParameters
此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。
輸入
None
您無法使用管線將輸入傳送至此 Cmdlet。
輸出
None
此 Cmdlet 不會產生任何輸出。
備註
- 若要在 Windows Vista 和更新版本的 Windows 作業系統上執行 Restore-Computer 命令,請使用 [以系統管理員身分執行] 選項開啟 Windows PowerShell。
- 此 Cmdlet 使用 Windows Management Instrumentation (WMI) SystemRestore 類別。