It's not really a security measure in that sense. It's a "safety feature" that prevents accidentally running such a script. Anything can trivially disable the protection using a bat script (or anything else) to bootstrap.
E.g. `powershell.exe -ExecutionPolicy Unrestricted`