Adding assemblies to Powershell studio project

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
whiggs2
Posts: 38
Joined: Sat Sep 23, 2017 11:59 pm

Adding assemblies to Powershell studio project

Post by whiggs2 » Mon Feb 26, 2018 6:12 am

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: SAPIEN PowerShell Studio 2018
Version 5.5.149
32 or 64 bit version of product: 64-bit
Operating system: Microsoft Windows 10 Enterprise
10.0.16299 N/A Build 16299
32 or 64 bit OS: 64-bit

*** Please add details and screenshots as needed below. ***
How exactly does the "assemblies" feature in powershell studio work? I have an assembly that I used to be able to import successfully and use within a powershell project I am working on (dll can be found in zip file at https://gallery.technet.microsoft.com/s ... t-a832f7bd), and it still works when I run it from my machine. However, when I run the packaged executable from a test machine I create, the action which is supposed to occur with the dll does not occur. Why is this? I thought the dll was embedded in the executable and would be run from any machine?


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

User avatar
Alexander Riedel
Posts: 7054
Joined: Tue May 29, 2007 4:43 pm

Re: Adding assemblies to Powershell studio project

Post by Alexander Riedel » Mon Feb 26, 2018 6:56 am

An assembly is basically a fancy .NET name for a DLL :D. DLLs contain executable code, just like an EXE file, just that it is supposed to be shared code.
So there is no embedding DLLs within an EXE, it goes counter the idea of sharing code in a Dynamic Link Library.
You can create an installer (MSI) which then installs your packaged script along with that DLL and any other required auxiliary files.
That's the prescribed way of distributing anything that requires multiple files.
Alexander Riedel
SAPIEN Technologies, Inc.