This policy setting allows you to configure script scanning. If you enable or do not configure this setting script scanning will be enabled. If you disable this setting script scanning will be disabled.
Solution
Policy Path: Windows Components\Microsoft Defender Antivirus\Real-time Protection Policy Setting Name: Turn on script scanning