An execution policy is part of the PowerShell security strategy. Execution policies determine whether you can load configuration files, such as your PowerShell profile, or run scripts. And, whether scripts must be digitally signed before they are run. To read the current exec. policy we can use the command Get-ExecutionPolicy
. If you can't run PS scripts (try to execute .\scripts\day002.ps1
to see the current PS version), you need to open a Windows terminal as Administrator, then run set-ExecutionPolicy RemoteSigned -Scope CurrentUser
. Be aware of the security risks here, anyone having access to your user can run PS scripts. To have a better view of the current exec. policy for every scope you can run Get-ExecutionPolicy -list
.