Would you like to learn how to encode Powershell scripts as Base64? In this tutorial, we will show you encrypt a Powershell script as Base64 and run the encoded version on Windows.
• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 2022
• Windows 10
• Windows 11
Equipment list
Here you can find the list of equipment used to create this tutorial.
This link will also show the software list used to create this tutorial.
Related tutorial – PowerShell
On this page, we offer quick access to a list of tutorials related to PowerShell.
Tutorial Windows – Encoding a Powershell script as Base64
Start a Powershell command-line.
Create a Powershell script inside a variable.
Encode the Powershell script as Base64.
Here is the command output.
Run the encoded Powershell script.
There are multiple ways to run a Base64 encoded script.
Congratulations! You are able to encode a Powershell script as Base64.
Tutorial Powershell – Encoding a PS1 script as Base64
Start a Powershell command-line.
Create a Powershell script
Edit the Powershell script.
Here is the script content.
Encode the Powershell script as Base64.
Here is the command output.
Run the encoded Powershell script.
There are multiple ways to run a Base64 encoded script.
Optionally, create a text file containing a Base64 script.
Run the encoded PS1 script file.
Congratulations! You are able to encode a PS1 script as Base64.