I want to run PowerShell scripts on Windows 7 as a regular user. Whenever I try, I get the following error:
File C:\\Users\\danv\\Documents\\WindowsPowe
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
This will set the execution policy for the current user (stored in HKEY_CURRENT_USER) rather than the local machine (HKEY_LOCAL_MACHINE). This is useful if you don't have administrative control over the computer.
If you (or a helpful admin) runs Set-ExecutionPolicy
as administrator, the policy will be set for all users. (I would suggest "remoteSigned" rather than "unrestricted" as a safety measure.)
NB.: On a 64-bit OS you need to run Set-ExecutionPolicy
for 32-bit and 64-bit PowerShell separately.
This should solve your problem, you should try to run the following below:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser