Start-Job Button: UpdateScript - receive-job problem

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 3 years and 7 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.
User avatar
mark106
Posts: 27
Last visit: Thu Mar 21, 2024 2:29 pm
Has voted: 1 time

Start-Job Button: UpdateScript - receive-job problem

Post by mark106 »

Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.172
OS: Windows 7 Professional (64 Bit)
Build: v6.1.7601.65536

Hi,

I'm trying to use the UpdateScript section of the templated Start-Job button. However, when I receive the job (within the UpdateScipt section) it flashes up a "searching for available modules" dialog - and it does this for each "refresh", creating a moving cascade of dialog boxes.

  1.     UpdateScript = {
  2.             Param ([System.Management.Automation.Job]$Job)
  3.             $results = Receive-Job -Job $Job -Keep
  4.             #Animate the Button
  5.  

It never seems to flash up one of these dialogs in the CompletedScript section when receiving the same job.

However, if the -keep parameter is removed, the dialog only appears on the first pass of UpdateScript - even if the job "HasMoreData" on subsequent refreshes. Again, it never seems to appear on CompletedScript.


I can recreate the problem by
  • Creating a new Forms project
  • Adding a start-job button
  • uncommenting the Receive-Job command in the UpdateScript section
Any ideas what's happening here?

Best regards,
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Start-Job Button: UpdateScript - receive-job problem

Post by brittneyr »

I have not been able to reproduce this behavior. From the message that pops up, it sounds like there is an additional module that needs to be imported for Windows 7. The parameter -keep is meant to leave data that has been added to streams as the job runs which otherwise would have been erased.
Brittney
SAPIEN Technologies, Inc.
This topic is 3 years and 7 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.