Product, version and build: PowerShell Studio 2018 build 5.5.155
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 Enterprise
32 or 64 bit OS: 64 bit
I have a multi-form GUI project that is saved in Program Files. The project imports the ActiveDirectory module, and loads a combo box with results from a Get-ADComputer command. If I run PS Studio as an Admin, everything works great while in the PSS editor. When I compile that project into an exe file and run the exe as an Admin, the main form loads, but the combo box does not populate. The project is compiled using the SAPIEN PowerShell v2 Host (Windows Forms) script engine. I feel this is a symptom of a larger problem. Is there a log file or logs in the Event Viewer that might help track down the breakdown? It *shouldn't* be a permissions issue. Thanks in advance!
Complied exe file not working
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.
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.
Re: Complied exe file not working
When you run the script in PowerShell Studio, what PowerShell version / platform (x64 or x86) are you using? Make sure your selected package engine matches the settings in PowerShell Studio.
Note: The Windows Form engines suppresses all output. Try using a Commandline engine for debugging, so that any output or errors will appear in the console window.
Note: The Windows Form engines suppresses all output. Try using a Commandline engine for debugging, so that any output or errors will appear in the console window.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Complied exe file not working
Ah, thank you. Compiling using the Commandline engine pointed me the right direction. I was using $PSScriptRoot to read an xml file in the same folder as the exe. Once I changed the variable to $ScriptDirectory everything started working as expected! Thanks again!