New
#60
Update on the Powershell script to display the status of Real-time Protection when you toggle it.
Open Notepad and paste the following in it. Save it as tog.ps1.
Code:$preferences = Get-MpPreference #gets preferences for the Windows Defender scans and updates Set-MpPreference -DisableRealtimeMonitoring (!$preferences.DisableRealtimeMonitoring) #toggle Real-time Protection ON/OFF $status = $preferences.DisableRealtimeMonitoring #store current status of Real-time Protection in $status Write-host " " if ($status) { Write-host "Real-time Protection is ON" } Else { Write-host "Real-time Protection is OFF" } Write-host " " Write-host "Press any key to exit" $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")|out-null #pause and wait for key press
Right-click on an empty area on your desktop and select Shortcut.
Paste the following in the ‘Browse’ box but replace the ‘Path to script’ with the actual path to the script you created.
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Utilities\+Misc\tog.ps1"
Once you’ve created the shortcut, right-click it and select the ‘Run as administrator’ option.
When you run the script, the current status of Real-time Protection will be displayed as ON or OFF.
Of course, you can also pin the shortcut to the start menu and/or the taskbar.
Last edited by Brink; 27 Feb 2018 at 10:47. Reason: code box