PrimeO7 / How-to-undervolt-AMD-RYZEN-5800X3D-Guide-with-PBO2-Tuner

Get the Most out of your 5800X3D using PBO Curve Optimizer!
421 stars 27 forks source link

ExecutionPolicy security #4

Open DeltaNachos opened 2 years ago

DeltaNachos commented 2 years ago

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.

Jeyd02 commented 1 year ago

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.

ghost commented 1 year ago

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

DeltaNachos commented 1 year ago

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

PrimeO7 commented 1 year ago

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

momorious commented 1 year ago

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

PrimeO7 commented 1 year ago

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

skysyk commented 1 year ago

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.