A comment for standard users:
To run the script, the suitable execution policy is needed. Standard is usually "restricted", which does not allow to start scripts.
to change it, use this command:
after executing the script set execution policy back to "restricted":
Here you can find more information: