By default powershell prevent the user to run a script file (.ps1), in order to enable the execution of script we have to manually enable it.
First check your powershell execution policy
Get-ExecutionPolicy
Restricted
If it shows “Restricted” then you will have to enable it
We can use "Unrestricted"
phrase to enable it
Set-ExecutionPolicy Unrestricted
It will prompt confirmation, if you want it to force put "-f"
in the command. The command will look like this
Set-ExecutionPolicy Unrestricted -f
Now you can run your scripts on your Powershell.