Product, version and build:
64 bit version of product: Powershell Studio 2019 v5.6.156
Operating system: 64 bit Windows 10 Enterprise
Using sychronized hashtable and xml with STA
The script will not generate the xml nor the csv.
In addition, I'm not seeing the additional window indicating the psjob is running.
I have plenty of error reporting but no errors are generated in the output window.
This runs without issue from ISE.
My settings are pretty basic:
no config file, no STA mode as that is already in the script, no impersonation nor runas.
I've tried all the Script Engines for v5 Host with the exception of service and Tray App.
PSJob not running for v5 Host (silent)
Forum rules
Do not post any licensing information in this forum.
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 any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: PSJob not running for v5 Host (silent)
[TOPIC MOVED TO WINDOWS POWERSHELL FORUM BY MODERATOR]
I recommend selecting a console host to debug the executable. The silent host suppresses all output, including errors.
I addition, if you are doing any asynchronous operations, you much make sure you wait for the operation to complete otherwise the script will terminate when it gets to the end.
I recommend selecting a console host to debug the executable. The silent host suppresses all output, including errors.
I addition, if you are doing any asynchronous operations, you much make sure you wait for the operation to complete otherwise the script will terminate when it gets to the end.
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PSJob not running for v5 Host (silent)
Thank you for your reply davidc.
Unfortunately, I've tried a console host and nothing spits out. I tried again for the sake of testing and no errors.
I also ran the debug in powershell studio.
SAPIEN PowerShell V5 Host (Command line)
The receive-job has the -wait parameter which I hope is sufficient.
The script starts with "Please wait, contacting database..."
I've double checked the output window link and it matches correctly.
Unfortunately, I've tried a console host and nothing spits out. I tried again for the sake of testing and no errors.
I also ran the debug in powershell studio.
SAPIEN PowerShell V5 Host (Command line)
The receive-job has the -wait parameter which I hope is sufficient.
The script starts with "Please wait, contacting database..."
I've double checked the output window link and it matches correctly.
Re: PSJob not running for v5 Host (silent)
I went through you code. In a couple of minutes I threw out almost half as redundant or incorrect.
I suggest that you test each piece of code without a form. Be sure that you remove all unnecessary lines and take advantage of good PS coding style and standards. This will make the code more predictable and much easier to understand.
Note that 'jobs" do not have a window or a display. If the thread that the job is running on terminates the job will disappear. Running a job in a delegate will fail because the delegate has limited access to the WPF form and the session that executed the delegate call. An "[action]" is a delegate. It is intended to trigger events and to set properties and is not intended as a remote function executor.
Looking at your code I find it very hard to understand what you are trying to accomplish and why it has to be run as a delegate.
I suggest that you test each piece of code without a form. Be sure that you remove all unnecessary lines and take advantage of good PS coding style and standards. This will make the code more predictable and much easier to understand.
Note that 'jobs" do not have a window or a display. If the thread that the job is running on terminates the job will disappear. Running a job in a delegate will fail because the delegate has limited access to the WPF form and the session that executed the delegate call. An "[action]" is a delegate. It is intended to trigger events and to set properties and is not intended as a remote function executor.
Looking at your code I find it very hard to understand what you are trying to accomplish and why it has to be run as a delegate.