How-to-undervolt-AMD-RYZEN-5800X3D-Guide-with-PBO2-Tuner icon indicating copy to clipboard operation
How-to-undervolt-AMD-RYZEN-5800X3D-Guide-with-PBO2-Tuner copied to clipboard

ExecutionPolicy security

Open DeltaNachos opened this issue 3 years ago • 7 comments

Is it necessary to run in Unrestricted machine-wide? I have found it works by adding the argument -ExecutionPolicy Bypass before my file path for the icon.

DeltaNachos avatar Aug 20 '22 02:08 DeltaNachos

Is it necessary to run in Unrestricted machine-wide? I have found it works by adding the argument -ExecutionPolicy Bypass before my file path for the icon.

I confirm this. Also added this into the argument, as it would bypass the script for this instance only.

Jeyd02 avatar Sep 09 '22 23:09 Jeyd02

Hi @DeltaNachos, @Jeyd02 Can you please share the file? Thanks!

ghost avatar Sep 30 '22 14:09 ghost

This is what I have in task scheduler as my 2nd action -ExecutionPolicy Bypass -File "C:\Program Files (x86)\PBO Tuner\Alert.ps1"

DeltaNachos avatar Sep 30 '22 20:09 DeltaNachos

I will add this change in the coming days if not too busy. Sorry for the delay, lots of studying.

PrimeO7 avatar Oct 18 '22 00:10 PrimeO7

When adding this line to the scheduled task, how to revert the execution in PowerShell if its already made?

momorious avatar Oct 25 '22 20:10 momorious

Hey @momorious ! Sorry for the extremely late answer.

To revert the ExecutionPolicy back to default run this command as Admin in Powershell:

Set-ExecutionPolicy -ExecutionPolicy Default

or

Set-ExecutionPolicy -ExecutionPolicy Restricted

PrimeO7 avatar Dec 14 '22 22:12 PrimeO7

FYI, it's also possible to use Python to generate a toast pretty easily, I'll leave it here in case anyone prefers to do it this way.

Install win11toast (https://github.com/GitHub30/win11toast) pip install win11toast

Create a script as follows in your PBO2 Tuner directory (e.g. notification.pyw):

from win11toast import toast
import os

toast('PBO2 Tuner', 'CO Offsets Applied', icon = f"{os.path.abspath(os.path.dirname(__file__))}\icons\icons8-ryzen-controller-64.png")

The example icon I'm using is from this site: https://icons8.com/icon/Q14IW6gC1Mgy/ryzen-controller. win11toast also supports using URLs directly.

Add an action to your scheduled task to start your pythonw.exe with argument of "{PBO2 Tuner Directory}\notification.pyw"

Customize as desired.

skysyk avatar Feb 27 '23 08:02 skysyk