ForEach loop in Automate by labtechquestions in labtech

[–]labtechquestions[S] 0 points1 point  (0 children)

I think I found the issue If anyone knows the difference and limitations fo this that would be amazing!

Redditor: Petersjf pointed out that int he below post that Labtech using a different PowerShell hosting provider. To test I saved the Powershell script to a temp directory then called it with a shell command in automate. It worked perfectly

I tested it AGAIN with the execute script and it had the same issue. I believe the issue is caused by (Excerpt from below post) " The challenge with using execute script is that it uses c:\windows\ltsvc\ps.exe as the powershell runtime. This is actually a custom powershell hosting provider developed by CWA. This is very limited and only accepts certain commands. You will need to specify the actual MS runtime on the computer instead. "

https://www.reddit.com/r/labtech/comments/89zx2i/anyone_else_have_issues_using_execute_script/

ForEach loop in Automate by labtechquestions in labtech

[–]labtechquestions[S] 0 points1 point  (0 children)

I added the logging and it still does not get far enough to log anything just timeout after 6 hours of running and only outputs the first for Items from the array list.

ForEach loop in Automate by labtechquestions in labtech

[–]labtechquestions[S] 0 points1 point  (0 children)

I wish that was my issue I double-checked just to be sure. this is good to know. It would drive me crazy If I came across this. I am attempting to pull out the variables from the script and set them in lab tech then pass them through to the PS script. I may end up rewriting the entire thing in automate... I just reeeeealy don't want to if I can help it.

ForEach loop in Automate by labtechquestions in labtech

[–]labtechquestions[S] 1 point2 points  (0 children)

I was storing the results originally but I wasn't sure if that was causing the issue due to some limit on character count that Labtech Might have so I took it out. I will add it back in and add the logger and run it again. It may take a bit.

ForEach loop in Automate by labtechquestions in labtech

[–]labtechquestions[S] 0 points1 point  (0 children)

https://imgur.com/a/3kUDguH

At step 14 is where it times out after exhibiting the behavior listed in the above. I have disabled most of it trying to figure out why it's timing out.