Sript won't run after compile - no error log

Use this forum to ask questions after your subscription maintenance expires or 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.
This topic is 4 years and 11 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.
plautodfl
Posts: 30
Last visit: Thu Jun 09, 2022 6:09 am

Sript won't run after compile - no error log

Post by plautodfl »

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?
The result of a successful script from powershell_ise
The result of a successful script from powershell_ise
2019-04-18_14-32-13.png (66.27 KiB) Viewed 17694 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 191 times
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 7:24 am
Answers: 39
Been upvoted: 30 times

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

Post by brittneyr »

Are you compiling your script into an executable?
Brittney
SAPIEN Technologies, Inc.
plautodfl
Posts: 30
Last visit: Thu Jun 09, 2022 6:09 am

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

Post by plautodfl »

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 17678 times
plautodfl
Posts: 30
Last visit: Thu Jun 09, 2022 6:09 am

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

Post by plautodfl »

Attaching the config file added .txt so it would upload
Attachments
ReceiverCleanupv16.exe.config.txt
(342 Bytes) Downloaded 194 times
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

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

Post by davidc »

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
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

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

Post by davidc »

There is also a known packager issue in the v161 that has been resolved in the v162 build.
David
SAPIEN Technologies, Inc.
plautodfl
Posts: 30
Last visit: Thu Jun 09, 2022 6:09 am

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

Post by plautodfl »

Going to try the *.162 download and also impersonate a user.
Thanks!
~P.
This topic is 4 years and 11 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.