Script folder

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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 11 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
balkanweb
Posts: 16
Last visit: Mon May 09, 2016 12:44 pm

Script folder

Post by balkanweb »

i'm using the following on startup.pfs
$global:ParentFolder = Split-Path (Get-Variable MyInvocation -scope 1 -ValueOnly).MyCommand.Definition
to get the folder where the script is running from.

When i run the Project on editor it works fine. When i compile project it does not return anything.

Any idea ??
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Script folder

Post by davidc »

Get-Variablie doesn't work when using the packager. Instead use the Get-ScriptDirectory function in the project's Global.ps1 file. There is also a snippet that contains the function definition.

David
David
SAPIEN Technologies, Inc.
This topic is 11 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.