Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecutionPolicy security #4

Open
DeltaNachos opened this issue Aug 20, 2022 · 7 comments
Open

ExecutionPolicy security #4

DeltaNachos opened this issue Aug 20, 2022 · 7 comments
Assignees

Comments

@DeltaNachos
Copy link

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
Copy link

Jeyd02 commented Sep 9, 2022

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
Copy link

ghost commented Sep 30, 2022

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

@DeltaNachos
Copy link
Author

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

@PrimeO7
Copy link
Owner

PrimeO7 commented Oct 18, 2022

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

@momorious
Copy link

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

@PrimeO7
Copy link
Owner

PrimeO7 commented Dec 14, 2022

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 PrimeO7 self-assigned this Dec 14, 2022
@skysyk
Copy link

skysyk commented Feb 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants