I have had the below error when trying to load PowerShell modules (my own, personally written) for sometime. I used to be able to completely get rid of it by adding Windows Defender exclusions, but now it is fixed for some weeks (but no change to the module code at all).
No matter that the folder and the file are added to the exclusion list, both PowerShell 5.1 and 7.1.2 give me a fixed error and it is impossible to import my (completely safe, personally written!) module.
Please help with this as it's becoming more and more frustrating trying to deal with Microsoft's out of control and aggressive false-positive tagging that even completely ignores its own exclusion list?
Note: adding to the Windows Defender exclusion list just completely fails here, the error happens even if the script is in the exclusion list.
Import-Module Custom-Tools
# Error seen on PowerShell 5.1 console:
FullyQualifiedErrorId : ScriptContainedMaliciousContent
# Error seen on PowerShell 7.1.2 console:
This script contains malicious content and has been blocked by your antivirus software.