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

Added possibility to run any PowerShell code (encoded as base64) using new protocol ToastRunPSBase64 #20

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ztrhgf
Copy link

@ztrhgf ztrhgf commented Jan 22, 2021

Now you can run any PowerShell code by clicking on Action buttons.

How to do it:

$command = @'
mkdir C:\temp\base64
'@

# encode to base64
$bytes = [System.Text.Encoding]::Unicode.GetBytes($command)
$encodedString = [Convert]::ToBase64String($bytes)

Now use value of $encodedString in config XML like:

<Option Name="Action1" Value="ToastRunPSBase64:bQBrAGQAaQByACAAQwA6AFwAdABlAG0AcABcAGIAYQBzAGUANgA0AA==" />
<Text Name="ActionButton1">Run base64</Text>		

Thats it. Now when you show notification and click on 'Run base64' button, folder base64 will be created in C:\temp

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

Successfully merging this pull request may close these issues.

1 participant