Sript won't run after compile - no error log

Use this forum to ask questions before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
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.
plautodfl
Posts: 17
Joined: Tue Apr 16, 2019 8:16 pm

Sript won't run after compile - no error log

Post by plautodfl » Thu Apr 18, 2019 11:36 am

To help you better we need some information from you.

*** Please fill in the fields below if you are currently using a Trial Version of the Product. 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: PowerShell Studio 2019 5.6.161.0
32 or 64 bit version of product: 64 Bit
Operating system:
32 or 64 bit OS: 64 Bit

*** Please add details and screenshots as needed below. ***
My script runs as expected from Powershell when RunAs Adminitrator
My script references UNC Path and works. I did see reference on the forum to modifying the config.xml file, but was not clear where to add the code.
I am unable to find where the executable errors. Is there a log file somewhere?
2019-04-18_14-32-13.png
The result of a successful script from powershell_ise
2019-04-18_14-32-13.png (66.27 KiB) Viewed 10049 times
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Attachments
ReceiverCleanupv6.ps1
The script that runs from powershell_ise
(12.03 KiB) Downloaded 23 times

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

Re: Sript won't run after compile - no error log

Post by brittneyr » Thu Apr 18, 2019 12:01 pm

Are you compiling your script into an executable?
Brittney Ryn
SAPIEN Technologies, Inc.

plautodfl
Posts: 17
Joined: Tue Apr 16, 2019 8:16 pm

Re: Sript won't run after compile - no error log

Post by plautodfl » Thu Apr 18, 2019 1:44 pm

I am compiling into an executable.
When I run the script in debugger mode, it works great.
When I run the exe, I get the directory name is invalid.
I have tested other scripts that access \\unc names so I am not sure this is the problem.
But it is worth a shot as \\machine\shares\....
Attachments
invaliddirectory.png
invaliddirectory.png (10.03 KiB) Viewed 10033 times

plautodfl
Posts: 17
Joined: Tue Apr 16, 2019 8:16 pm

Re: Sript won't run after compile - no error log

Post by plautodfl » Thu Apr 18, 2019 1:47 pm

Attaching the config file added .txt so it would upload
Attachments
ReceiverCleanupv16.exe.config.txt
(342 Bytes) Downloaded 22 times

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

Re: Sript won't run after compile - no error log

Post by davidc » Fri Apr 19, 2019 6:35 am

When using Run As, make sure you run the executable from a location that is accessible to the Run As user.

In addition, if credentials are required for the network drive, the Run As user might not be able to access it, because it is not running as the current user.

Alternatively, you can use Impersonate User, which gives the executable access to current user's folders.
David
SAPIEN Technologies, Inc.

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

Re: Sript won't run after compile - no error log

Post by davidc » Fri Apr 19, 2019 7:09 am

There is also a known packager issue in the v161 that has been resolved in the v162 build.
David
SAPIEN Technologies, Inc.

plautodfl
Posts: 17
Joined: Tue Apr 16, 2019 8:16 pm

Re: Sript won't run after compile - no error log

Post by plautodfl » Mon Apr 22, 2019 8:56 am

Going to try the *.162 download and also impersonate a user.
Thanks!
~P.