Cannot find a variable with the name AmsiContextIssue In the execution of discovery, while running PowerShell mid server script, the message "Cannot find a variable with the name AmsiContext" was noticed in MID server log. ReleaseAnyCauseAMSI is agnostic of antimalware vendor; it's designed to allow for the most common malware scanning and protection techniques provided by today's antimalware products that can be integrated into applications. It supports a calling structure allowing for file and memory or stream scanning, content source URL/IP reputation checks, and other techniques.AMSI also supports the notion of a session so that antimalware vendors can correlate different scan requests. For instance, the different fragments of a malicious payload can be associated to reach a more informed decision, which would be much harder to reach just by looking at those fragments in isolation.The above explained is from Microsoft: https://docs.microsoft.com/en-us/windows/win32/amsi/antimalware-scan-interface-portal In this particular case, the customer had Sentinel Agent (SentinelOne ) antimalware installed on MID server hostResolutionBy uninstalling Sentinel Agent (SentinelOne) antimalware from MID server host, the issue "Cannot find a variable with the name AmsiContext" disappeared