generated from NeverToOldToLearn/Windows-Recall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindows Recall.ps1
21 lines (19 loc) · 1.01 KB
/
Windows Recall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Check if running as administrator
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
# Relaunch as administrator
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
}
Start-Transcript -Path "C:\Temp\Recall\Log.txt"
# Check if Recall feature is enabled or disabled
Write-Host "Checking Recall feature status..." -ForegroundColor Cyan
$recallStatus = Invoke-Expression "Dism /Online /Get-Featureinfo /Featurename:Recall"
# Disable Recall if it's enabled
if ($recallStatus -match "State : Enabled") {
Write-Host "Recall feature is enabled. Disabling..." -ForegroundColor Yellow
Invoke-Expression "Dism /Online /Disable-Feature /Featurename:Recall"
Write-Host "Recall feature has been disabled." -ForegroundColor Green
} else {
Write-Host "Recall feature is already disabled." -ForegroundColor Green
}
Stop-Transcript