PowerShell Studio Feature RequestsFeature requests, product enhancement ideas, and other product-specific suggestions.
Options when compiling to Exe - Obfuscate Code
granttt, Feb. 11, 2019Under Review
Wondering if its possible when compiling a script to an exe that there can be an option to obfuscate the code.
Basic options to say "remove all comments" when compiling. Or "change function names and variable names to random values" would be a good start.
Main goal is to make it harder for someone to easily copy the code and understand it. While there is the Script block logging, and block transcripts options both require administrator access and thats not always suitable. There's opensource options out there but doesnt compile within the exe and a few steps to get it working. Example:
Comment by D.Leaman, Mar. 17, 2019
I'm not familiar with how the Invoke-Obfuscation module works, but you could use the Pre-build commands in the Script Packager to execute an obfuscation script before it's built into an exe.
Comment by granttt, Sep. 1, 2019
Basically pass a readable powershell file in and get an output file that's unreadable based on the options you select when running the script.
I'm unsure how I'd be able to do this with Powershell studio while still being able to compile the script on the fly to an exe.
e.g. Open Readable Project files - Press build button-> creates export .ps1 file then compiles to export? I'm not sure how I'd be able to intersect during the compiling to an exe.