# In GUI mode, skip the prompt and just try to enable it
if($script:GuiWindow-or$Silent-or$(Read-Host-Prompt"System restore is disabled, would you like to enable it and create a restore point? (y/n)")-eq'y'){
# Ensure that the user is aware if creating a restore point failed, and give them the option to continue without a restore point or cancel the script
if($failed){
if($script:GuiWindow){
$result=Show-MessageBox"Failed to create a system restore point. Do you want to continue without a restore point?""Restore Point Creation Failed""YesNo""Warning"
if($result-ne"Yes"){
$script:CancelRequested=$true
return
}
}
elseif(-not$Silent){
Write-Host"Failed to create a system restore point. Do you want to continue without a restore point? (y/n)"-ForegroundColorYellow
if($(Read-Host)-ne'y'){
$script:CancelRequested=$true
return
}
}
Write-Host"Warning: Continuing without restore point"-ForegroundColorYellow