Currently, powershell will attempt a script policy test by writing a powershell file named __PSScriptPolicyTest_(randomjunk).ps1 and fill it with a fixed string + timestamp. The stated purpose is to test for the presence of Windows AppLocker, but it's unwittingly running afoul of other third party app-locker-like solutions with similar but different behavior. The behavior difference here is some solutions like to inform the users a script was blocked, sometimes with a prompt to escalate to IT.
Normally the answer is to whitelist trusted files by hash, but the changing content of the file prevents this. And whitelisting by name is insecure.
This is essentially nuisance behavior that could be solved if a group policy was present to disable the use of the PSScriptPolicyTest test or even a group policy to make the contents of the generated file fully static such that the file hash can be trusted in third party security solutions.
This is also an unnecessary difference to Powershell V5, it does not increase security and as seen above triggers admins to introduce a security issue.
The default installed powershell uses a fixed hash file.
Activity
Rithari commented on May 15, 2025
Running into the same annoyance myself. +1
rdebath commented on Feb 12, 2026
This is also an unnecessary difference to Powershell V5, it does not increase security and as seen above triggers admins to introduce a security issue.
The default installed powershell uses a fixed hash file.