PSM1 Module to DLL

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
ecarbone
Posts: 1
Joined: Sun Mar 03, 2013 12:44 pm

PSM1 Module to DLL

Post by ecarbone » Mon Sep 02, 2019 12:51 pm

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PowershellStudio, 2019, 5.6.167
32 or 64 bit version of product:64 bit
Operating system:Windows 10 Pro
32 or 64 bit OS:64 Bit OS

*** Please add details and screenshots as needed below. ***

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

I'm new to Powershell Studio, just want to know if Powershell Studio can "compile" a powershell module to a DLL format in order to "hide" the source code. Or if that can't be done, if Powershell can minify or obfuscate the source code.

Thanks.

User avatar
brittneyr
Site Admin
Posts: 162
Joined: Thu Jun 01, 2017 7:20 am

Re: PSM1 Module to DLL

Post by brittneyr » Thu Sep 05, 2019 7:31 am

You cannot directly compile PowerShell into a DLL. You can write a DLL in C# or other Net language and use it from PowerShell.
In your case, maybe you should look into creating binary module in a compiled Net language, then you can obfuscate that.
You may find the following link helpful:
https://powershellexplained.com/2018-08 ... ry-Module/

But if you end goal is to have a dll, then you will need to use another .Net language.
Brittney Ryn
SAPIEN Technologies, Inc.