I have a powershell script that adds file exclusions to Windows Defender on a computer running Windows 10.
But I run the same script with Windows 8.1 but I get an error message saying:
Add-MpPreference : The 'Add-MpPreference' command was found in the module 'Defender', but the module could not be loaded. For more information, run 'Import-Module Defender'. At line:1 char:1 + Add-MpPreference -ExclusionPath "C:\Temp" + ~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Add-MpPreference:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
What can I do to make it work with Windows 8/8.1?