New
#41
PS commands for Defender require Admin rights to update any settings, but the script to clear Defender history needs the additional steps of removing a protected folder. That folder is owned by TrustedInstaller to prevent casual or malicious interference.
If you only need to Set-MpPreference, then always check the title of your CMD, PowerShell or Terminal window has the word "Administrator".