I recently get the powershell message "Execution Policy Changed" message when i execute .ps1 script file
--------------
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
---------------
This is unacceptable because i set the unrestricted on the CurrectUser.
----
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Unrestricted <<< HERE
LocalMachine Undefined
----
Any knows what happens???
This only occurs when machine CPU is very high load (more than 80%) and/or powershell is not cached on RAM.
Thanks in advance guys!!!
PS: Here is mi regedit entries for double-click behaviour:
HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\0\Command =
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-Command" "if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Mta -File '%1'"
AllSigned
instead of checking it every time... – T-MeUnrestricted
is not equalAllSigned
– T-Me