Moving globals.ps1

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum 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
Lembasts
Posts: 202
Joined: Thu Mar 15, 2012 9:47 am

Moving globals.ps1

Post by Lembasts » Mon Mar 28, 2016 4:11 pm

Product, version and build: PS 2015 4.2.99
32 or 64 bit version of product: 64
Operating system: WIndows 7
32 or 64 bit OS: 64

I wanted to make function I had created in globals.ps1 common to other projects so I moved this to another 'common' folder. What I noticed was that PS no longer recognized the functions when globals.ps1 was in a different folder to the project folder. Is this by design? If so, what is the recommended way to set up a common functions ps1 file to be used by multiple projects please?

Thanks
David

User avatar
Lembasts
Posts: 202
Joined: Thu Mar 15, 2012 9:47 am

Re: Moving globals.ps1

Post by Lembasts » Mon Mar 28, 2016 4:47 pm

I don't know if this is the best way but I created a new file called commonfunctions.ps1 and put that in a common folder which I added to each project. The trick was to change the command extension property to TRUE.

User avatar
Lembasts
Posts: 202
Joined: Thu Mar 15, 2012 9:47 am

Re: Moving globals.ps1

Post by Lembasts » Mon Mar 28, 2016 5:46 pm

Now the problem is that whenever I run Build in the Packager, the output exe file gets put in the 'common' folder and not the project folder. It's as if the Build places the exe wherever the last file was added from. I went into the engine settings to add a path to the output file but it wont let me add a UNC path. How do I control where the packager Build function outputs the exe file please?

User avatar
davidc
Posts: 5889
Joined: Thu Aug 18, 2011 4:56 am

Re: Moving globals.ps1

Post by davidc » Tue Mar 29, 2016 9:42 am

The globals.ps1 name is not important; only that the Build property is set to Include and the Command Extension property is set to True.

As for the exe path, I believe that issue was resolved in a later build. Please try reopening the project and hopefully that will restore the correct path.

David
David
SAPIEN Technologies, Inc.