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 9 years and 1 month 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.
The script will start the remote process on the remote computer and leave the remote process running after the start of the remote execution. The remote process continues to run until it finishes. There is no code in the script to remove the PSSession since doing so will terminate the remote process.
The script works fine when it is not packaged. However, when this script is packaged using either PowerShell V2 or V3 using PrimalScript 2015, the remote process immediately terminates after the execution.
It seems to me that when the packaged script terminates, it also kills the current PSSession. As a result, the remote process will always be terminated immediately after the execution.
How can I packaged this script so that it will leave the PSSession alone so that the remote process continues to run?
This is an automated post. A real person will respond soon.
Thank you for posting, clum09.
Did you remember to include the following?
1. Product, version and build (e.g. Product: PrimalScript 2014, Version & Build: 7.0.46. Version and build information can be found in the product's About box accessed by clicking the blue icon with the 'i' in the upper right hand corner of the ribbon.)
2. Specify if you are running a 32 or 64 bit version
3. Specify your operating system and if it is 32 or 64 bit.
4. Attach a screenshot if your issue can be seen on the screen
5. Attach a zip file if you have multiple files (crash reports, log entries, etc.) related to your issue.
If not, please take a moment to edit your original post or reply to this one.
*** Make sure you do not post any licensing information ***
PSSession requires a hosting process. When you run your script from a shell the script may terminate but the hosting process (the shell) is still running. So that works.
If you package a script, the process ends when you script ends, thus taking all PSSessions down with it.
In order to do what you want to do, you need to wait at the end of the script for the remote process to end.
This topic is 9 years and 1 month 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.